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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

centerAffix
boolean
false
Vertically centres the prepend/append icons relative to the input.
hideDetails
boolean | string
false
Hides the hint/error details area. Pass "auto" to hide when there is nothing to display.
hideSpinButtons
boolean
false
Hides the native browser spin buttons on number inputs.
hint
string
Helper text rendered below the input. Shown when persistentHint=true or on focus.
persistentHint
boolean
false
Always shows the hint, even when the input is not focused.
messages
Array<string> | string
Custom messages to display in the details area, alongside validation errors.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
density
TDensity
'default'
Adjusts the vertical padding density.
label
string
Accessible label for the input.
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
color
TColor
Focus/active color intent for the input.
bgColor
TColor
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
elevation
TElevation
height
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
direction
TDirection
'horizontal'
Layout direction — horizontal for standard inputs, vertical for stacked variants.
disabled
boolean
false
Disables the input entirely.
error
string | boolean
false
Forces the error state. Use with errorMessages to provide details.
errorMessages
Array<string> | string
One or more error messages shown when the input is in an error state.
maxErrors
number | string
name
string
readonly
boolean
false
Makes the input non-editable without disabling it.
rules
Array<any>
[]
Validation rules applied on blur / submit. Each rule is a function returning true or an error string.
modelValue
any
The current value. Bind with v-model.
validateOn
TValidateOn
When to trigger validation. Inherits the Form context when not set.
validationValue
any
focused
boolean
appendAvatar
string
appendIcon
TIcon
Icon rendered outside the input chrome on the right.
prependAvatar
string
prependIcon
TIcon
Icon rendered outside the input chrome on the left.
prependAriaLabel
string
appendAriaLabel
string
size
TSize | number
'default'
Controls the font-size and dimensions via design tokens.
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight

API

Slots

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

@update:modelValue
any
Emitted when the input value changes (v-model bridge).
@click:append
MouseEvent
Fired when the user clicks the outer append area.
@click:prepend
MouseEvent
Fired when the user clicks the outer prepend area.
@focus
FocusEvent
Fired when the input receives focus.
@blur
FocusEvent
Fired when the input loses focus.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Basic usage

vue

With validation rules

vue