Interaction JS behaviour

Slide to confirm

A thumb dragged along its track to confirm; the label fades with progress, a short drag springs back and the end turns into a check. Arrow keys and End work too, and it runs the other way in RTL.

Real scenarios

The component as it is used in a product — not a specimen grid.

Pay at the end of the track

Drag the thumb: the label fades as you go and a release short of the end springs back. Past 90% (or a quick flick past half) it confirms, the arrow turns into a check and the server answers. Tab to the thumb and use the arrows, or End.

Nabu Pro · yearly 49 $
Drag to the end, or press End, to confirm

End a live session

Danger tone for the action that drops 214 viewers at once; the reset button rewinds it from Alpine.

Drag to the end, or press End, to confirm

Right to left

The track runs right to left: drag toward the left, and the arrow keys follow the reading direction.

Drag to the end, or press End, to confirm

Important props

Important props
Prop Type Default What it does
label / doneLabel string '' / 'Done' The text inside the track and the one after confirming.
threshold float 0.9 The fraction of the track past which a release confirms; a quick flick past half counts too.
tone string 'accent' accent · danger · success.
action string null A Livewire method called on confirm; reset() rewinds the thumb.

Snippet

<x-nx::slide-to-confirm label="بکشید تا ۴۹ دلار پرداخت شود" done-label="پرداخت شد" action="pay" />