humanonlyweb/ui

Input

A text input with label, hint and error.

Markdown

Examples

Basic

Shown to everyone you invite.

Copy code

Prefix and suffix

Copy code

Validation

Copy code

API

PropTypeDefault
label

Visible label, linked to the control.

string—
hint

Help text under the control, announced as its description.

string—
error

true marks the control invalid; a string also shows it as the message, replacing the hint.

string | boolean—
prefix

Text shown before the input, e.g. a currency sign. Hidden from assistive tech.

string—
suffix

Text shown after the input, e.g. a unit. Hidden from assistive tech.

string—
optional

Appends the optional translation to the label.

booleanfalse
disabled

Disables the control.

booleanfalse
type

Native input type.

"date" | "datetime-local" | "email" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week""text"
size

Size hook, exposed as data-field-size.

"medium" | "small""medium"
id

Id for the control; generated with useId() when omitted.

string—
modelValue

The value.

string | number—
EventPayload
update:modelValue

v-model:modelValue update.

[value: string | number | undefined]
SlotProps
prefix

Replaces the prefix text, e.g. with an icon.

—
suffix

Replaces the suffix text.

—

Styling

Parts
fieldfield-labelfield-optionalinput-controlinput-prefixinputinput-suffixfield-message
States
data-field-sizedata-field-errordata-field-tone

Accessibility

  • Errors set aria-invalid and are announced.
  • Prefix and suffix are hidden from screen readers, so the label has to make sense without them.