Numeric spinner
Enter a number directly or adjust it using stacked or side-by-side controls.
Quantity
Choose a number from 1 to 9.
Recommended API
| Property or element | Type | Example initial value | Description |
|---|---|---|---|
type and name | Native input attributes | number, quantity | Expose one editable number for the quantity. |
min, max, step | Numbers | 1, 9, 1 | Define bounds and the size of each increment. |
value and required | Number and Boolean | 2, true | Provide the starting value and require a valid number. |
data-layout | stacked, sides | stacked | Place the step controls in a column or on either side of the field. |
States
| State | Trigger | Result |
|---|---|---|
stepping | Use the up or down button or arrow key. | The quantity changes by one and the matching button is disabled at its bound. |
invalid | Type a value outside the range. | The browser marks the field invalid and retains the entered value. |
layout changed | Choose Stacked or Sides. | The controls move and the current value and validity are retained. |
CSS variables
| Variable | Type | Default | Description |
|---|---|---|---|
--q-text | color | #28302a | Main text and foreground color. |
--q-muted | color | #70776f | Color for secondary text. |
--q-font-size | length | 13px | Base size for the component text. |
--q-accent | color | #344e41 | Accent for active controls, indicators and focus. |
--q-surface | color | #ffffff | Surface for controls and cards. |
--q-border | color | #dce0d8 | Color for outlines and dividers. |
--q-radius | length | 10px | Base corner radius. |
--q-gap | length | calc(var(--q-space) * 2) | Space between items, based on the spacing unit. |
--q-control-px | length | calc(var(--q-space) * 4) | Horizontal padding for controls. |
--q-control-py | length | calc(var(--q-space) * 2.5) | Vertical padding for controls. |
--q-space | length | 4px | Base unit for gaps and padding. |