Odometer
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initFieldOdometer(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/input-odometerAbout 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