forms
Unit Scrubber
A numeric value with a unit can be scrubbed through a bounded surface while manual input remains precise.
- forms
- numeric
- scrub
- unit
- pointer
A unit-aware scrub field; Tactile Range remains the generic bounded preference control.
Live preview
Quick usage
import { UnitScrubber } from "@pinky-ui/systems";
<UnitScrubber label="Radius" defaultValue={24} unit="px" />Presets
Default
Restrained production behaviour.
Default behaviour
Quiet
Reduced intensity for dense product screens.
disabled={true}
Install
Add @pinky-ui/systems as a dependency, or use the CLI to copy this component's source directly into your project — no dependency to manage, fully editable.
npm install @pinky-ui/systemspnpm add @pinky-ui/systemsyarn add @pinky-ui/systemsnpx pinky-ui add unit-scrubberPrefer to run the whole repository locally instead?
git clone https://github.com/florash/Pinky-UI.git
cd Pinky-UI
npm install
npm run devProps
| Prop | Type | Default | Description |
|---|---|---|---|
| step | number | 1 | Bounded increment shared by pointer, keyboard and manual entry. |
| className | string | — | Styles the outer interaction surface. |
Accessibility
- The value remains a native number input with a visible unit; arrows and direct entry do not require scrubbing.
- Pointer capture ends on up, cancel and lost capture so page scrolling and later interactions remain safe.
Performance
- Pointer movement updates one bounded numeric value and no document listener is retained after the gesture.
Reduced motion
Motion resolves immediately while semantics, focus and state remain unchanged.
When to use
- Design tools, compact settings and values where spatial adjustment is meaningful
When not to use
- Unbounded numeric data or values where dragging would reduce precision
Skill
Purpose
Use Unit Scrubber for bounded design or product values where horizontal adjustment is meaningful but manual precision must remain available.
Interaction
Drag the labelled surface to change the value, while a native number input provides direct entry and arrow-key increments. Keep the unit and bounds visible.
Usage
<UnitScrubber label="Radius" defaultValue={24} min={0} max={64} unit="px" />Accessibility
Never make dragging the only path. Use a real number input, clear units, bounded values and pointer-capture cleanup on up, cancel and lost capture.
Reduced motion
Update the value without thumb travel. The number, unit and bounds remain the primary feedback.