Forms
VD3 UI ships framework-wide defaults for native form controls. Use the documented
.vd-* form classes for stable component markup, and load app-specific overrides after VD3 UI when embedding into an existing design system. In Vue 3, the <VdInput> component (below) wraps this markup with label / hint / error / prefix / suffix props. VdInput — label / hint / error / prefix / suffix
The Vue 3 <VdInput> bundles the common field anatomy — label, helper text, validation message and affixes — into one component on the unified status-variant palette. type="number" binds a real number.
As it appears on your card.
Enter a valid email address.
$USD
Bound value: 42 (number)
@
That username is available.Usage
<script setup lang="ts">
import { VdInput } from "@vanduo-oss/vd3";
const email = ref("");
const amount = ref(0);
</script>
<template>
<!-- Label + helper text -->
<VdInput v-model="email" type="email" label="Email"
hint="We'll never share it." />
<!-- Error message also styles the field as danger -->
<VdInput v-model="email" type="email" label="Email"
error="Enter a valid email address." />
<!-- Prefix / suffix + number model (emits a number) -->
<VdInput v-model="amount" type="number" label="Amount"
prefix="$" suffix="USD" />
</template>Component API
| Prop / event | Description |
|---|---|
v-model (modelValue) | Two-way value. Emits a number when type="number", otherwise a string. |
:label | Field label rendered above the input. |
:hint | Helper text below the input (hidden when error is set). |
:error | Error message; its presence also styles the input as danger. |
:prefix / :suffix | Static text/symbol before / after the input. #prefix / #suffix slots override the text props. |
:revealPassword | When type is password, render a type=button that toggles password ↔ text (aria-pressed, eye / eye-slash). Never autocomplete=off. |
:required | Marks the visible label with .label-required. |
:variant | 'success' | 'danger' validation state (error implies danger). |
:size | 'sm' | 'md' | 'lg' input height (default 'md'). |
native attrs | type, placeholder, disabled, readonly, required, min/max/step, minlength, maxlength, pattern, autocomplete, autocapitalize, spellcheck, inputmode, enterkeyhint… |
@blur / @focus | Forwarded focus events. |
Grouped inputs — VdCheckboxGroup / VdRadioGroup / VdSelect
Three Vue 3 wrappers build a full option group from a :options array and a v-model — a multi-select checkbox set, a single-choice radio set, and a themed native <select>.
Selected: a11y
Plan: pro
Framework: —
Usage
<script setup lang="ts">
import { ref } from "vue";
import { VdCheckboxGroup, VdRadioGroup, VdSelect } from "@vanduo-oss/vd3";
const checks = ref<string[]>(["a11y"]);
const plan = ref("pro");
const framework = ref("");
</script>
<template>
<VdCheckboxGroup
v-model="checks"
name="features"
:options="[
{ value: 'a11y', label: 'Accessibility' },
{ value: 'ssr', label: 'SSR-safe' },
]"
/>
<VdRadioGroup
v-model="plan"
name="plan"
:options="[
{ value: 'free', label: 'Free' },
{ value: 'pro', label: 'Pro' },
]"
/>
<VdSelect
v-model="framework"
name="framework"
placeholder="Choose a framework"
:options="[
{ value: 'vue', label: 'Vue 3' },
{ value: 'nuxt', label: 'Nuxt' },
]"
/>
</template>Component API (Vue 3)
| Component | Props (v-model + options) |
|---|---|
VdCheckboxGroup | v-model (string[]) · :options ({ value, label, disabled? }) · :name · :inline · :size · :disabled |
VdRadioGroup | v-model (string) · :options ({ value, label, disabled?, icon? }) · :name · :inline · :size · :disabled |
VdSelect | v-model (string) · :options ({ value, label, disabled? }) · :name · :id · :placeholder · :disabled · :required |
VdCheckbox | v-model (boolean) · :label · :disabled · :size (sm|md|lg) · :name · :id · default slot (label override) |
VdOtpInput | v-model (string) · :length (default 6) · :disabled · :name · :id · :labelledBy |
VdCustomSelect | v-model (string) · :options ({ value, label, disabled? }) · :id · :name · :placeholder (default "Select...") |
Input Fields
Choose an option
Option 1
Option 2
Option 3
Custom-select wiring (other inputs are pure CSS):
Form Controls
Form Validation States
Looks good!
Please provide a valid value.
Input Groups
USD
https:///api
Input Sizes
Password Toggle
Class Reference
| Class | Description | Type |
|---|---|---|
.vd-form-group | Wrapper for form controls (adds margin, stacking) | Structure |
.vd-input | Base styling for text, email, password, select | Base |
.vd-input-sm | Compact input height and font size | Size |
.vd-input-lg | Taller input height and larger font size | Size |
.vd-input-group | Wrapper for input + prefix/suffix buttons or text | Structure |
.vd-input-group-prefix | Text or icon before the input inside a group | Structure |
.vd-input-group-suffix | Text or icon after the input inside a group | Structure |
.vd-input-reveal | VdInput password-reveal control (type=button, aria-pressed) | Modifier |
.textarea | Base styling for multiline text inputs | Base |
.checkbox | Wrapper for custom checkbox controls | Structure |
.radio | Wrapper for custom radio button controls | Structure |
.switch | Wrapper for toggle switch controls | Structure |
.range | Custom styling for range/slider inputs | Base |
.vd-input-valid | Applies success indicator and green border | State |
.vd-input-invalid | Applies error indicator and red border | State |
.vd-form-feedback | Base class for validation message text | Structure |
.vd-form-feedback-valid | Success validation message (green) | State |
.vd-form-feedback-invalid | Error validation message (red) | State |
disabled | Native attribute to disable any form control | State (attr) |