Slide to approve (Pro)
ProIncluded in $99Slide to confirm for payments, sends and deletes: ink follows the thumb, the words invert as it passes, and a short slide is thrown back.
On this page
ProDrag the thumb: ink fills the track and the words invert as it passes. Let go early and it is thrown back; reach the end and it pays.
Drag the thumb and the track fills in ink behind it; the words turn to paper as the ink passes over them. Let go short of the end and the thumb is thrown back with one small overshoot, the one place the kit allows one, because your hand threw it. A quick flick counts: the release projects where the throw would land. At the end the thumb becomes a run check while the action works, then lands on a check.
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { SlideToApprove } from "@/components/ui/chatcn/pro/slide-to-approve"
<SlideToApprove
label="Slide to pay €64.20"
status={status}
labels={{ working: "Paying", done: "Booked, ticket sent" }}
onConfirm={pay}
/>Examples
States
ProThe slider at rest, sending, sent with its receipt line, and the bank declining.
Props
| Prop | Type | Notes |
|---|---|---|
label | string | The track text and the accessible name |
onConfirm | () => void | On reaching the end, or on Enter |
status | "idle" | "working" | "done" | "error" | Back to idle glides the thumb home |
labels | { working?, done?, error? } | Track text per later status |
threshold | number | How far the thumb must travel, 0 to 1. Default 0.86 |
disabled | boolean |
Keyboard
EnterorEndon the focused thumb confirms.
Accessibility
role="slider"with the current status asaria-valuetext, so a screen reader hears Paying and then the result.- Past either end the thumb resists like a rubber band instead of stopping dead.
- In a right to left layout the thumb travels the other way.
Motion
- Drag writes the thumb, the ink
clip-pathand the label fade in the same frame. The release hands the measured velocity to the spring. - Reduced motion: the thumb returns without the throw.