Slide to Confirm
ProNewTactile drag-to-confirm slider button with shimmering track prompt, progressive fill, and spring snap-back.
Installation
pnpm dlx shadcn@latest add @viewport/slide-to-confirm
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| label | stringShimmering track label shown before confirmation. | "Slide to deploy" |
| confirmedLabel | stringLabel shown once confirmed. | "Deployed" |
| tone | "default" | "destructive"Visual emphasis for destructive or primary actions. | "default" |
| onConfirm | () => voidCalled once the thumb reaches the end of the track. | — |
| className | string | — |
Accessibility
- Focusable button that also confirms via Enter or Space for keyboard and assistive-tech users.
- Confirmation state is announced through a status region.
- Shimmer and spring snap-back respect prefers-reduced-motion.