Enter
Buttons

Counter

A quantity stepper. The value rolls in the direction of travel — up when incrementing, down when decrementing.

Circle buttons
Disabled

Usage

<Counter
  defaultValue={1}
  size="md"
  intensity="normal"
  spring="smooth"
  circle
  min={0}
  max={10}
  step={1}
/>

How the motion works

The readout renders both the outgoing and incoming digit during a change, driven by one shared spring so they stay locked together instead of drifting apart the way two independent animations would. Direction is taken from the sign of the change. The buttons reuse SquishButton, so press feedback is the same physics as everywhere else in the library.

RollingNumberusePressuseSpringValue

Props

PropTypeDefaultDescription
valuenumberControlled value. Omit for uncontrolled use.
defaultValuenumber0Initial uncontrolled value.
onChange(value: number) => voidFires on every committed change.
min / maxnumberBounds. Buttons disable at the limits.
stepnumber1Amount added or removed per press.
circlebooleantrueRound the increment buttons.
labelstring"Quantity"Accessible name for the spinbutton.