Input
Form & Input
stable
Base input wrapper that provides validation, labels, hints, adjacent slots and focus management. Consumed internally by all typed input components.
API
Props
All props accepted by this component, with their type, default value and description.
- centerAffixbooleanfalse
- Vertically centres the prepend/append icons relative to the input.
- hideDetailsboolean | stringfalse
- Hides the hint/error details area. Pass "auto" to hide when there is nothing to display.
- hideSpinButtonsbooleanfalse
- Hides the native browser spin buttons on number inputs.
- hintstring
- Helper text rendered below the input. Shown when persistentHint=true or on focus.
- persistentHintbooleanfalse
- Always shows the hint, even when the input is not focused.
- messagesArray<string> | string
- Custom messages to display in the details area, alongside validation errors.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- densityTDensity'default'
- Adjusts the vertical padding density.
- labelstring
- Accessible label for the input.
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- colorTColor
- Focus/active color intent for the input.
- bgColorTColor
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- elevationTElevation
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- directionTDirection'horizontal'
- Layout direction — horizontal for standard inputs, vertical for stacked variants.
- disabledbooleanfalse
- Disables the input entirely.
- errorstring | booleanfalse
- Forces the error state. Use with errorMessages to provide details.
- errorMessagesArray<string> | string
- One or more error messages shown when the input is in an error state.
- maxErrorsnumber | string
- namestring
- readonlybooleanfalse
- Makes the input non-editable without disabling it.
- rulesArray<any>[]
- Validation rules applied on blur / submit. Each rule is a function returning true or an error string.
- modelValueany
- The current value. Bind with v-model.
- validateOnTValidateOn
- When to trigger validation. Inherits the Form context when not set.
- validationValueany
- focusedboolean
- appendAvatarstring
- appendIconTIcon
- Icon rendered outside the input chrome on the right.
- prependAvatarstring
- prependIconTIcon
- Icon rendered outside the input chrome on the left.
- prependAriaLabelstring
- appendAriaLabelstring
- sizeTSize | number'default'
- Controls the font-size and dimensions via design tokens.
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
API
Slots
Content slots exposed by this component.
- #default
- The native input control. Downstream components (TextField, NumberField, …) inject their <input> here.
- #messages
- Replaces the default hint / error messages block.
- #message
- #details
- Replaces the entire details area below the input (hint + counter + errors).
- #prepend
- Custom content rendered outside the input chrome on the left.
- #append
- Custom content rendered outside the input chrome on the right.
API
Emits
Events emitted by this component.
- @update:modelValueany
- Emitted when the input value changes (v-model bridge).
- @click:appendMouseEvent
- Fired when the user clicks the outer append area.
- @click:prependMouseEvent
- Fired when the user clicks the outer prepend area.
- @focusFocusEvent
- Fired when the input receives focus.
- @blurFocusEvent
- Fired when the input loses focus.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic usage
With validation rules