Props
| Name | Type | Default | Description |
|---|---|---|---|
append:icon | string | undefined | - | Name of the icon to be added at the end of the input. The append position shows one thing at a time, by priority: clear button, then spinner, then the error or warning icon, then this. On a |
autocomplete | string | undefined | - | Guides to the browser as to the type of information expected in the field. Set it on every field in an auth or checkout flow. Search and filter boxes need |
autofocus | Booleanish | undefined | - | Sets autofocus on page load. The replacement for the template-ref API v3 removed: there is no exposed |
clearable | boolean | undefined | false | Displays a clear button when the input has a value and is being interacted with. There is no |
compact | boolean | undefined | false | Displays the component in a compact version. A property of a view, not of a field. Two densities in one form read as a seam. See example |
description | string | undefined | - | Descriptive text displayed below the label and above the input. Unlike the hint it is always
visible, and it is linked to the input via Always visible, and read before typing — the place for an instruction. |
direction | InputDirection | undefined | - | Direction of the layout of the component. Can either be a predefined value or a
pattern separated by a space like Applies only while the resolved label mode is |
disabled | boolean | undefined | false | Disables the component. Blocks the keyboard too, so a disabled value is unreachable for someone navigating that way. Prefer |
emitMasked | boolean | undefined | false | Emits the masked value of the input. Off by default, so the model holds the digits while the field shows the separators. Turn it on when the formatted string is the value you store — and do not strip formatting server-side that was never sent. See example |
errors | string | string[] | undefined | - | Can be a string or an array of string containing the messages to display.
They render in an A non-empty value implies the error state, so |
hasErrors | boolean | undefined | false | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. Sets |
hasWarnings | boolean | undefined | false | Define if the component should be in a warning state.
Same chrome as errors with The warning counterpart of |
hideLabel | boolean | undefined | false | Visually hides the label of the input while maintaining accessibility. Keeps the accessible name and removes only the visible text. It is the answer for a search box that shows just a placeholder; omitting |
hint | string | undefined | - | Text box to be displayed near the input, usually to indicate instructions. Shown while the field has focus, unless |
id | string | undefined | - | The identifier of the component. |
inputMode | "text" | "none" | "search" | "email" | "url" | "tel" | "numeric" | "decimal" | undefined | - | The inputmode of the input. Steers the mobile keyboard independently of |
labelrequired | string | - | Text content of the label of the element. Required, and display and accessibility only: it does not set the |
labelMode | "outside" | "floating" | "inside" | undefined | - | Label rendering mode. A bare |
labelPosition | "left" | "center" | "right" | undefined | - | Sets the text alignment of the label. |
loading | boolean | undefined | false | Sets the component in a loading state, usually triggering some visual styles. Visual only: the field stays editable. If the value must not change while an async check runs, write that guard yourself and tag requests so a stale response cannot overwrite a newer one. See example |
mask | MaskInputOptions | undefined | - | The mask to be applied to the input. Please visit https://beholdr.github.io/maska/v3 for syntax examples. A maska config, live-reactive — changing the options reformats the current value. Masks format, they do not validate: a complete-but-wrong value still needs an error. See example |
modelValuerequired | string | null | - | Used by v-model. |
name | string | undefined | - | Defines the name of the input. Unset, the rendered |
persistentHint | boolean | undefined | false | Keeps the hint displayed. |
placeholder | string | undefined | - | String displayed when there's no data. |
prepend:icon | string | undefined | - | Name of the icon to be added at the start of the input. |
pt | PtMap<TextControlPtPart, FormControlPtState> | undefined | - | Passthrough, object form: |
pt:box | PtValue | undefined | - | |
pt:box:disabled | PtValue | undefined | - | |
pt:box:errors | PtValue | undefined | - | |
pt:box:has-value | PtValue | undefined | - | |
pt:box:loading | PtValue | undefined | - | |
pt:box:readonly | PtValue | undefined | - | |
pt:box:warnings | PtValue | undefined | - | |
pt:clear | PtValue | undefined | - | |
pt:clear:disabled | PtValue | undefined | - | |
pt:clear:errors | PtValue | undefined | - | |
pt:clear:has-value | PtValue | undefined | - | |
pt:clear:loading | PtValue | undefined | - | |
pt:clear:readonly | PtValue | undefined | - | |
pt:clear:warnings | PtValue | undefined | - | |
pt:description | PtValue | undefined | - | |
pt:description:disabled | PtValue | undefined | - | |
pt:description:errors | PtValue | undefined | - | |
pt:description:has-value | PtValue | undefined | - | |
pt:description:loading | PtValue | undefined | - | |
pt:description:readonly | PtValue | undefined | - | |
pt:description:warnings | PtValue | undefined | - | |
pt:hint | PtValue | undefined | - | |
pt:hint:disabled | PtValue | undefined | - | |
pt:hint:errors | PtValue | undefined | - | |
pt:hint:has-value | PtValue | undefined | - | |
pt:hint:loading | PtValue | undefined | - | |
pt:hint:readonly | PtValue | undefined | - | |
pt:hint:warnings | PtValue | undefined | - | |
pt:icon | PtValue | undefined | - | |
pt:icon:disabled | PtValue | undefined | - | |
pt:icon:errors | PtValue | undefined | - | |
pt:icon:has-value | PtValue | undefined | - | |
pt:icon:loading | PtValue | undefined | - | |
pt:icon:readonly | PtValue | undefined | - | |
pt:icon:warnings | PtValue | undefined | - | |
pt:input | PtValue | undefined | - | |
pt:input:disabled | PtValue | undefined | - | |
pt:input:errors | PtValue | undefined | - | |
pt:input:has-value | PtValue | undefined | - | |
pt:input:loading | PtValue | undefined | - | |
pt:input:readonly | PtValue | undefined | - | |
pt:input:warnings | PtValue | undefined | - | |
pt:label | PtValue | undefined | - | |
pt:label:disabled | PtValue | undefined | - | |
pt:label:errors | PtValue | undefined | - | |
pt:label:has-value | PtValue | undefined | - | |
pt:label:loading | PtValue | undefined | - | |
pt:label:readonly | PtValue | undefined | - | |
pt:label:warnings | PtValue | undefined | - | |
pt:message | PtValue | undefined | - | |
pt:message:disabled | PtValue | undefined | - | |
pt:message:errors | PtValue | undefined | - | |
pt:message:has-value | PtValue | undefined | - | |
pt:message:loading | PtValue | undefined | - | |
pt:message:readonly | PtValue | undefined | - | |
pt:message:warnings | PtValue | undefined | - | |
pt:prefix | PtValue | undefined | - | |
pt:prefix:disabled | PtValue | undefined | - | |
pt:prefix:errors | PtValue | undefined | - | |
pt:prefix:has-value | PtValue | undefined | - | |
pt:prefix:loading | PtValue | undefined | - | |
pt:prefix:readonly | PtValue | undefined | - | |
pt:prefix:warnings | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:disabled | PtValue | undefined | - | |
pt:root:errors | PtValue | undefined | - | |
pt:root:has-value | PtValue | undefined | - | |
pt:root:loading | PtValue | undefined | - | |
pt:root:readonly | PtValue | undefined | - | |
pt:root:warnings | PtValue | undefined | - | |
pt:spinner | PtValue | undefined | - | |
pt:spinner:disabled | PtValue | undefined | - | |
pt:spinner:errors | PtValue | undefined | - | |
pt:spinner:has-value | PtValue | undefined | - | |
pt:spinner:loading | PtValue | undefined | - | |
pt:spinner:readonly | PtValue | undefined | - | |
pt:spinner:warnings | PtValue | undefined | - | |
pt:suffix | PtValue | undefined | - | |
pt:suffix:disabled | PtValue | undefined | - | |
pt:suffix:errors | PtValue | undefined | - | |
pt:suffix:has-value | PtValue | undefined | - | |
pt:suffix:loading | PtValue | undefined | - | |
pt:suffix:readonly | PtValue | undefined | - | |
pt:suffix:warnings | PtValue | undefined | - | |
readonly | boolean | undefined | false | Sets the input in a readonly state. Keeps the value focusable, selectable and copyable while refusing edits — the honest choice for a value the user did not set but may need to read or copy. See example |
required | boolean | undefined | false | Sets the input as required. Forwards to the native input for the browser's own validation. It does not produce a message: |
reverse | boolean | undefined | false | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
type | "text" | "search" | "email" | "url" | "tel" | "password" | undefined | "text" | Type of the input. Restricted to the textual input types this component
supports — use Narrowed in v3 to the text-like types. |
variant | InputVariantType | undefined | 'outline' | Visual variant of the field box — the same names and tokens as the
|
warnings | string | string[] | undefined | - | Warning messages to display beneath the field, in their own The amber channel, for a value that is accepted and still worth a second look. Unlike |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | string | null |
|
Events
| Name | Type | Description |
|---|---|---|
blur | (event: "blur", event: FocusEvent): void | |
change | (event: "change", event: Event): void | Fires on commit — blur or Enter — which makes it the right hook for an expensive side effect. |
click | (event: "click", event: MouseEvent): void | |
compositionend | (event: "compositionend", event: CompositionEvent): void | |
compositionstart | (event: "compositionstart", event: CompositionEvent): void | |
focus | (event: "focus", event: FocusEvent): void | |
input | (event: "input", event: Event): void | |
keydown | (event: "keydown", event: KeyboardEvent): void | |
keyup | (event: "keyup", event: KeyboardEvent): void | |
mousedown | (event: "mousedown", event: MouseEvent): void | |
mouseup | (event: "mouseup", event: MouseEvent): void | |
paste | (event: "paste", event: ClipboardEvent): void | |
update:modelValue | (event: "update:modelValue", value: string | null): void |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
append | object | Content rendered after the text input, at the end of the field box. |
append-outer | object | Content rendered after the entire text input control, outside the input chrome. Outside the field chrome, and the only affix position that may hold something interactive. See example |
description | BbTextInputDescriptionSlotProps | Replaces the description text. Provided alone (no |
label | BbTextInputLabelSlotProps | Replaces the default label text rendered above the input. Receives |
prefix | object | Inline content rendered at the start of the input field area, before the typed text. Short inline text hugging the value. Affixes never take focus, so a click here lands in the input — which makes this the wrong home for a button and |
prepend | object | Content rendered before the text input, at the start of the field box. |
prepend-outer | object | Content rendered before the entire text input control, outside the input chrome. |
suffix | object | Inline content rendered at the end of the input field area, after the typed text. See example |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
hasWarninghasWarningsfails silently