Skip to content

Input ​

Single-line text field; choose it for short free text. Use textarea for multi-line text, number-input for numbers with steppers, and combobox for a filterable list.

Usage ​

vue
<Label for="email">Email</Label>
<Input id="email" v-model="email" type="email" />

Props ​

PropTypeDefaultNotes
modelValuestring''v-model
size'md' | 'sm' | 'lg''md'
invalidbooleanfalseSets aria-invalid and the danger border
disabledbooleanfalse
classstringnoneApplied to the wrapper

Native attributes (type, placeholder, readonly, autocomplete, required, id) fall through to the input element, not the wrapper.

Slots ​

SlotContent
leadingIcon or text before the value
trailingIcon, text, or a small button after the value

Events ​

EventPayloadWhen
update:modelValuestringOn input

Native focus, blur, and keydown pass through from the input.

Tokens ​

TokenFalls back toControls
--h-input-radius--h-radius-mdCorner radius

States ​

default, hover, focus-visible, filled, placeholder, disabled, readonly, invalid; three sizes; with leading slot, trailing slot, and both.

Keyboard ​

Native text input behavior. No custom keys.

Accessibility ​

  • The component renders no label. Pair it with label by id, or let form wire it.
  • The focus ring is drawn on the wrapper when the inner input has focus.
  • Placeholder text uses subtle-foreground and never replaces a label.
  • Clicking a non-interactive slot focuses the input.

Do ​

vue
<Input v-model="query" type="search" placeholder="Search customers">
  <template #leading><Icon name="search" /></template>
</Input>

Do not ​

vue
<!-- Placeholder used as the only label: it disappears on input. -->
<Input v-model="email" placeholder="Email" />