Odometer

Guests
Drag the number to scrub
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/input-odometer

About this component

A number stepper whose digits are mechanical wheels: each one rolls to its new figure (the tens wheel slides in and out as it is needed), and you can step with the buttons, the arrow keys, or by dragging the number sideways to scrub. Pushing past a limit bumps against it.

Triggers

  • Click
  • State change
  • Spring
  • Delay stagger

Techniques

  • CSS variables
  • CSS transition
  • Spring
  • Event position

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

The number is a role="spinbutton" with aria-valuemin/max/now and aria-valuetext ("8 guests"); Arrow keys, Page Up/Down, Home and End work. The buttons are labelled and marked aria-disabled at the limits rather than disabled, so focus is never lost.

Reduced motion

The wheels jump.

Use it in anything you build, commercial and client work included. Licence

More inputs

See all
PeekGet code
AuroraGet code