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 is contested, by priority: clear button → spinner ( |
autocomplete | string | undefined | "off" | Guides the browser as to the type of information expected in the field. |
autofocus | Booleanish | undefined | - | Sets autofocus on page load. |
clearable | boolean | undefined | false | Displays a clear button when the input has a value and is being interacted with. Emits |
compact | boolean | undefined | false | Sets the component in a compact state. The only density knob — this family has no |
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 For what the user needs before typing. Anything about the acceptable range reads better in |
direction | InputDirection | undefined | - | Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like Ignored — silently — unless the resolved label mode is |
disabled | boolean | undefined | false | Disables the component. Blocks everything, arrow-key stepping included. For a number that is derived or detected rather than forbidden, |
errors | string | string[] | undefined | - | Can be a string or an array of string containing the messages to display.
They render in an Where a business rule lives, since |
hasErrors | boolean | undefined | false | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. Forces the error chrome without a message of its own. Reach for it when the text lives in a summary alert above the form. See example |
hasWarnings | boolean | undefined | false | Define if the component should be in a warning state.
Same chrome as errors with The amber counterpart of |
hideLabel | boolean | undefined | false | Visually hides the label of the input while maintaining accessibility. |
hint | string | undefined | - | Text box to be displayed near the input, usually to indicate instructions. The natural home for the range or the unit, because |
id | string | undefined | - | The identifier of the component. |
labelrequired | string | - | Text content of the label of the element. Names the field for display and for assistive technology only. It does not set |
labelMode | "outside" | "floating" | "inside" | undefined | - | Label rendering mode. Unset, it falls back to the project-wide |
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 underneath the spinner, so if an async check has to settle before the value is usable, guard that yourself. See example |
max | number | undefined | Number.MAX_SAFE_INTEGER | Maximum value cap. Clamps the emitted value with no message and no event, so a user who types past it sees their number change under them. Say the ceiling in |
maxPrecision | number | undefined | 8 | Maximum precision of the number.
|
min | number | undefined | Number.MIN_SAFE_INTEGER | Minimum value cap. Clamps the emitted value in silence, the same way |
modelValuerequired | string | number | null | null | Used by v-model. Accepts |
name | string | undefined | - | Defines the name of the input. Not derived from |
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. The uncontested position: nothing in the component competes for it. Put decorative iconography here and keep |
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. The right state for a number that is computed or detected rather than entered — a total, a weight read off a scale. Unlike |
required | boolean | undefined | false | Sets the input as required. Forwards to the native input and validates nothing on its own. In a validated form it is also one of the two things that raise the required asterisk, the other being a literal |
reverse | boolean | undefined | false | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
step | number | undefined | 1 | Incremental unit used by ArrowUp / ArrowDown and by the Drives ArrowUp/ArrowDown and the |
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 For a number that is valid and still worth a second look. Errors win when both are set and the warnings are suppressed, so the field is never amber and red at once. See example |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
modelValue | string | number | null | Seed it with |
Events
| Name | Type | Description |
|---|---|---|
blur | (event: "blur", event: FocusEvent): void | |
change | (event: "change", event: Event): void | |
click | (event: "click", event: MouseEvent): void | |
compositionend | (event: "compositionend", event: CompositionEvent): void | |
compositionstart | (event: "compositionstart", event: CompositionEvent): void | |
decrease | (event: "decrease", value: number): void | See example |
focus | (event: "focus", event: FocusEvent): void | |
increase | (event: "increase", value: number): void | Fires with the **new**, already clamped number, alongside |
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: number | null): void | Emits |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Type | Description |
|---|---|---|
append | BbNumberInputStepSlotProps | Content rendered after the number input, at the end of the inner container. Typically used to place increment/decrement buttons next to the input. Same |
append-outer | BbNumberInputStepSlotProps | Content rendered after the entire input control, outside the input chrome. The uncontested place for an action beside the field, since nothing inside the component competes for it. |
description | BbNumberInputDescriptionSlotProps | Replaces the description text. Provided alone (no |
label | BbNumberInputLabelSlotProps | Replaces the default label text rendered above the number input. Receives |
prefix | BbNumberInputStepSlotProps | Inline content rendered at the start of the input field area, before the typed number. Decoration only, inside the field. A currency symbol belongs here and never in the model. See example |
prepend | BbNumberInputStepSlotProps | Content rendered before the number input, at the start of the inner container. Receives |
prepend-outer | BbNumberInputStepSlotProps | Content rendered before the entire input control, outside the input chrome. Outside the field chrome entirely. Reach for it when a stepper button should not sit inside the border — or when the append position is already taken by a clear button or a spinner. |
suffix | BbNumberInputStepSlotProps | Inline content rendered at the end of the input field area, after the typed number. The unit — |
Changes from v2
Props removed or renamed in 3.0. If you are coming from v2, the answer is here.
hasWarninghasWarningsfails silently