Input
A text input with label, hint and error.
MarkdownExamples
Basic
Shown to everyone you invite.
Prefix and suffix
Validation
Enter a valid email address.
API
| Prop | Type | Default |
|---|---|---|
labelVisible label, linked to the control. | string | — |
hintHelp text under the control, announced as its description. | string | — |
error
| string | boolean | — |
prefixText shown before the input, e.g. a currency sign. Hidden from assistive tech. | string | — |
suffixText shown after the input, e.g. a unit. Hidden from assistive tech. | string | — |
optionalAppends the | boolean | false |
disabledDisables the control. | boolean | false |
typeNative input type. | "date" | "datetime-local" | "email" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week" | "text" |
sizeSize hook, exposed as | "medium" | "small" | "medium" |
idId for the control; generated with | string | — |
modelValueThe value. | string | number | — |
| Event | Payload |
|---|---|
update:modelValue
| [value: string | number | undefined] |
| Slot | Props |
|---|---|
prefixReplaces the | — |
suffixReplaces the | — |
Styling
- Parts
fieldfield-labelfield-optionalinput-controlinput-prefixinputinput-suffixfield-message- States
data-field-sizedata-field-errordata-field-tone
Accessibility
- Errors set
aria-invalidand are announced. - Prefix and suffix are hidden from screen readers, so the label has to make sense without them.