Kinetic
A Figma-like Scrub Number Input for React: drag to scrub, click to type. Digit animation by . Owned scrub/edit engine.
Full API reference: (Features tab).
Features
- Horizontal and vertical scrub with pointer-lock gesture
- Click-to-edit with select-all on focus
- Keyboard: Up/Down arrows, Alt (
smallStep), Shift (largeStep), Home/End - Optional wheel scroll and logo-handle scrub surface
- Bound feedback: shake or border pulse
- Digit animation by (slots or number variant)
- Overflow: left-aligned values; long values clip on the right, full value on hover/edit
Installation
Use the Command tab for registry install, Manual for copy-paste setup. API reference lives on the Features tab. The live demo at /demo mirrors the playground structure.
Command
Add the registry to components.json:
Then install:
Prerequisites: shadcn base-nova with input and input-group.
Manual
- Install dependencies
- Add shadcn components
- Copy source files into your project:
components/ui/scrub-number-input.tsxcomponents/ui/scrub-number-input.csslib/scrub-number-overflow.tshooks/use-controllable-state.tsx
- Update import paths to match your
@/aliases.
Quick start
Uncontrolled
Custom formatting
Use format (Intl.NumberFormatOptions) for display formatting via formatValue.
Display overflow
Fields stay a fixed width so digit animation does not shift layout. When a value is too long:
- Display mode: left-aligned; overflow clips on the right.
- Hover: native
titletooltip shows the full formatted value when truncated. - Edit mode: click opens the full value string, not the clipped display.
Main props (ScrubNumberField)
Gestures
Up/Down arrows nudge by step. Alt = fine step (smallStep), Shift = coarse step (largeStep).
Publishing
Kinetic distributes via the shadcn namespace registry at . See docs/DISTRIBUTION.md [blocked].
Install
See above. The demo at /demo copies generated props from the Usage section after you tweak settings.
Demo
Run pnpm dev and open /demo. Adjust settings in the panel, then copy the generated props snippet from the Usage section.
Build registry locally
Outputs public/r/scrub-number-field.json. Test against http://localhost:3000/r/{name}.json before deploy.
Development
License
MIT