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

PropTypeDefaultDescription
labelReactNode"Slide to confirm"What the track says at rest, wiped by the handle as it comes.
confirmedLabelReactNode"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.
resetAfternumber—Milliseconds the confirmed state stands before it resets. Unset, it stays confirmed.
disabledbooleanfalseThe handle won't move and the track dims.
widthnumber280The track's length in px, 220 to 380. Every distance in it is a fraction of the travel, so all of it follows.
cornernumber28The track's corner in px, a pill at 28. The handle's is this less its 4px inset.
speednumber50How quickly it takes over once let go, 0 to 100, always critically damped.