Drag Stepper
betaA pill number stepper: tap − or + to step, or hold either one to stretch into a sweep and drag to scrub.
- Forms
- 1 file
- 2 npm packages
- Accessibility notes
pnpm dlx @dowel-ui/cli add drag-steppernpm packages installed: class-variance-authority, radix-ui.
import { DragStepper } from "@/components/ui/drag-stepper";Default
Gallery
With Units
Disabled
<DragStepper>
| Prop | Type | Default |
|---|---|---|
decrementLabelAccessible name of the − button. | string | "Decrease" |
defaultValueInitial value when uncontrolled. | number | 24 |
disabled | boolean | false |
fill | "light" | "dark" | "light" |
formatValueSpoken value ( | (value: number) => string | — |
holdDelayMilliseconds a side button must be held to enter sweep mode. | number | 250 |
incrementLabelAccessible name of the + button. | string | "Increase" |
largeStepSteps moved by Page Up / Page Down (multiplied by | number | 10 |
max | number | 100 |
min | number | 0 |
nameSubmits the value with a form under this name. | string | — |
onValueChangeCalled on every change: tap, key, typed entry and each sweep move. | (value: number) => void | — |
sensitivityUnits scrubbed per pixel of horizontal drag in sweep mode. | number | 0.6 |
step | number | 1 |
strokeA 1px inset hairline ring around the pill. | boolean | false |
valueControlled value. | number | — |
Plus every attribute of <div> except defaultValue, onChange, children.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes