Components
BaseNumberInput
A number field with increment and decrement controls, limits and steps.
components/ui/inputs/BaseNumberInput.vue
View in the demo
Example
API
It also accepts every prop, slot and event of v-number-input, which it passes through.
Props
Name | Type | Default | Description |
|---|---|---|---|
label | string | — | The visible label above the field, linked to it with for and aria-labelledby. |
input-id | string | — | A fixed id for the input. One is generated with useId() when you leave it out. |
optional | boolean | — | Adds “(optional)” after the label. Never mark required fields. |
info | BaseInputInfo | — | A help popover next to the label: a text or a list of { title, text }. |
Use min, max and step from v-number-input, and control-variant (default, split, stacked, hidden) to place the buttons.
Accessibility
The label is always visible and linked to the input. Error messages are announced through aria-describedby and the field gets aria-invalid. Set type, inputmode and autocomplete so phones show the right keyboard and browsers can autofill.