Slide to confirm
DarkInspect
A handle you push across a track, for the one action a stray tap must never set off: checkout's last step. It follows the finger exactly and commits only at the very end of the track; let go short of it and it springs home. On commit the handle unfurls back over what it crossed and becomes the confirmation, its arrow turning to a check. Enter or Space on the handle carries it across for the keyboard. The one above stands confirmed for a moment and resets, so slide it twice.
Examples
Stays confirmed
Without resetAfter it stays confirmed, as at checkout, where the next screen takes over. To offer the slide again after a payment that failed, give it a new key.
DarkInspect
Disabled
Not yet payable: the handle won't move.
DarkInspect
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | "Slide to confirm" | What the track says at rest, wiped by the handle as it comes. |
| confirmedLabel | ReactNode | "Confirmed" | What the handle says once it fills the track, beside a check. |
| onConfirm | () => void | — | Called once, the moment the slide commits, as the handle unfurls. |
| resetAfter | number | — | Milliseconds the confirmed state stands before it resets. Unset, it stays confirmed. |
| disabled | boolean | false | The handle won't move and the track dims. |
| width | number | 280 | The track's length in px, 220 to 380. Every distance in it is a fraction of the travel, so all of it follows. |
| corner | number | 28 | The track's corner in px, a pill at 28. The handle's is this less its 4px inset. |
| speed | number | 50 | How quickly it takes over once let go, 0 to 100, always critically damped. |