TextField
Form & Input
stable
Full-featured text input field with label, placeholder, counter, masking, validation, prepend/append icons and multiple visual variants.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- autofocusbooleanfalse
- Focuses the input on mount.
- counterboolean | number | string
- Displays a character counter. Pass a number to set the max.
- counterValuenumber | ((e: any) => number)
- placeholderstring
- Placeholder text shown when the field is empty.
- persistentPlaceholderboolean
- persistentCounterboolean
- rolestring
- typeTTextFieldType'text'
- HTML input type. Drives the browser keyboard on mobile and enables native validation.
- modelModifiersstring | boolean
- maskTMask
- Input mask spec — a built-in preset key ('phone:fr'…), a raw pattern ('(##) ###-####') or a full options object. v-model exposes the unmasked value.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- colorTColor
- Active/focus color of the field border and label.
- densityTDensity'default'
- Adjusts the input padding density.
- centerAffixboolean
- dirtyboolean
- disabledbooleanfalse
- Disables the input — prevents focus and user interaction.
- errorstring | boolean
- inlineboolean
- labelstring
- Floating label shown above or inside the field.
- prefixstring
- suffixstring
- persistentClearboolean
- singleLineboolean
- requiredboolean
- loadingTControlLoadingValuefalse
- Shows a loading indicator below the field.
- tagstring
- loadingTextstring
- bgColorTColor
- appendInnerAvatarstring
- appendInnerIconTIcon
- Icon rendered inside the field, after the input text.
- prependInnerAvatarstring
- prependInnerIconTIcon
- Icon rendered inside the field, before the input text.
- clearIconTIcon
- clearablebooleanfalse
- Shows a clear icon when the field has a value.
- prependInnerAriaLabelstring
- appendInnerAriaLabelstring
- 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
- focusedboolean
- textstring
- floatingboolean
- namestring
- 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
- 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
- roundedboolean | number | string | TRounded | null | undefined
- Border-radius token for the field wrapper.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- letterSpacingTLetterSpacing
- activeboolean | IStateEffectConfig
- activeClassstring
- variantTVariantInput'outlined'
- Visual style of the field wrapper.
- elevationTElevation
- sizeTSize | number
- hideDetailsboolean | stringfalse
- Hides the hints/errors area. auto hides it when there is no content to show.
- hideSpinButtonsboolean
- hintstring
- persistentHintboolean
- messagesArray<string> | string
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- directionTDirection
- errorMessagesArray<string> | string
- Validation error messages rendered below the field.
- maxErrorsnumber | string
- readonlybooleanfalse
- Makes the input read-only — displays but does not allow editing.
- rulesArray<any>
- modelValueany
- Bound value of the text field. Bind with v-model.
- validateOnTValidateOn
- validationValueany
- appendAvatarstring
- appendIconTIcon
- Icon rendered outside the field, after the input.
- prependAvatarstring
- prependIconTIcon
- Icon rendered outside the field, before the input.
- prependAriaLabelstring
- appendAriaLabelstring
API
Slots
Emplacements de contenu exposés par ce composant.
- #counter
- Custom character counter renderer.
- #field
- Replaces the entire inner field surface — advanced use only.
- #default
- Inner content of the field — rarely used directly.
- #prepend-inner
- Custom content inside the field, before the input.
- #loader
- #append-inner
- Custom content inside the field, after the input.
- #label
- Custom label content, replaces the text label.
- #floatingLabel
- #prefix
- #suffix
- #prependInner
- #appendInner
- #clear
- #details
- #prepend
- Custom content before the field (outside the border).
- #append
- Custom content after the field (outside the border).
- #messages
- #message
API
Emits
Événements émis par ce composant.
- @click:controlMouseEvent
- Fired when the user clicks the control surface (the field wrapper).
- @mousedown:controlMouseEvent
- Fired on mousedown on the control surface.
- @validboolean
- Emitted on every input/paste when a mask is active — carries the current validity status.
- @complete{ complete: boolean, unmasked: string }
- Emitted when every slot of the mask has been filled.
- @update:focusedany
- @click:appendInnerMouseEvent
- @click:prependInnerMouseEvent
- @click:clearMouseEvent
- Fired when the clear icon is clicked.
- @update:modelValueany
- Fired on every input change. When a mask is active, carries the unmasked value.
- @click:appendMouseEvent
- Fired when the user clicks the append icon area.
- @click:prependMouseEvent
- Fired when the user clicks the prepend icon area.
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 text field
Variants
Input mask