Numeric input
Takes a number, with steppers for small adjustments such as thresholds.
Try it
Press the steppers, or tab to one and press Enter.
Steppers
Error
Disabled
<WildTextInput
v-model="threshold"
size="lg"
type="quantity"
/>When to use
- Use it for a whole number people adjust in small steps, such as an alarm threshold.
Don’t use it
- For text, or a number nobody nudges, such as a phone number. Use Text input or Phone input.
Anatomy
A 44px field with a decrease and an increase stepper inside the frame.
lg · 44
<WildTextInput v-model="threshold" type="quantity" size="lg" />States
The same five states as the text input.
rest
hover
focus
error
disabled
Accessibility
The steppers are buttons named Decrease and Increase. When the field is disabled, so are they.
| Key | What it does |
|---|---|
| Tab | Moves to the decrease stepper, then the increase stepper. |
| Enter / Space | Steps the number down or up. |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| modelValue | number | — | The number. |
| type | 'quantity' | — | Adds the steppers. |
| size | 'lg' | 'lg' | Always 44px; the steppers need it. |
| error | boolean | string | false | Red border; a string also shows the message. |
| disabled | boolean | false | Greys the field and disables the steppers. |
Tokens
| Token | Value | Where it lands |
|---|---|---|
| --radius-field | 10px | The frame. |
| --radius-lg | 8px | The steppers. |
| (no token) | 34px | Stepper size. |
| --global-blue-1000 | #1877F2 | Border on focus, 2px. |
| (no token) | 15px | The number. |
| --color-grey-800 | #7F7D83 | Stepper icon at rest. |
| --color-grey-1000 | #2D2B32 | Stepper icon on hover. |