Back to library

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 elementTypeExample initial valueDescription
type and nameNative input attributesnumber, quantityExpose one editable number for the quantity.
min, max, stepNumbers1, 9, 1Define bounds and the size of each increment.
value and requiredNumber and Boolean2, trueProvide the starting value and require a valid number.
data-layoutstacked, sidesstackedPlace the step controls in a column or on either side of the field.

States

StateTriggerResult
steppingUse the up or down button or arrow key.The quantity changes by one and the matching button is disabled at its bound.
invalidType a value outside the range.The browser marks the field invalid and retains the entered value.
layout changedChoose Stacked or Sides.The controls move and the current value and validity are retained.

CSS variables

VariableTypeDefaultDescription
--q-textcolor #28302aMain text and foreground color.
--q-mutedcolor #70776fColor for secondary text.
--q-font-sizelength 13pxBase size for the component text.
--q-accentcolor #344e41Accent for active controls, indicators and focus.
--q-surfacecolor #ffffffSurface for controls and cards.
--q-bordercolor #dce0d8Color for outlines and dividers.
--q-radiuslength 10pxBase corner radius.
--q-gaplength calc(var(--q-space) * 2)Space between items, based on the spacing unit.
--q-control-pxlength calc(var(--q-space) * 4)Horizontal padding for controls.
--q-control-pylength calc(var(--q-space) * 2.5)Vertical padding for controls.
--q-spacelength 4pxBase unit for gaps and padding.