Slide to Confirm
betaA track whose grip you slide to the end to confirm — bencho's wash-and-morph pill or SmoothUI's power-off slide — with a press-and-hold path.
- Forms
- 1 file
- 3 npm packages
- Accessibility notes
- Animates with motion
pnpm dlx @dowel-ui/cli add slide-to-confirmnpm packages installed: class-variance-authority, motion, radix-ui.
import { SlideToConfirm } from "@/components/ui/slide-to-confirm";Default
Gallery
Stays Confirmed
Press And Hold
Right To Left
<SlideToConfirm>
| Prop | Type | Default |
|---|---|---|
confirmedLabelShown and announced once confirmed ("Confirmed" / "Shutting down…"). | string | — |
cornerTrack radius in px, 0–28. The grip and wash use corner − 4. Default 28. | number | 28 |
disabled | boolean | false |
fill | "light" | "dark" | "light" |
hintInstructions linked to the grip with aria-describedby. | string | "Drag to the end, or press and hold Enter or Space." |
holdDurationHow long Enter, Space or a still pointer must be held to confirm (ms). Default 1000. | number | 1000 |
labelNames the grip and shows on the track. Defaults per variant. | string | — |
onConfirmCalled once each time the slide completes. | () => void | — |
resetAfterMilliseconds before it resets itself; | number | null | — |
speedSpring speed for the snap-back and morph, 0–100. Default 50. | number | 50 |
stroke | boolean | — |
variant | "confirm" | "power" | "confirm" |
Plus every attribute of <div> except children.
8/8
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — does not apply
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — does not apply
- No fixed widths — passes