Drag the thumb to the end, or press Enter on it, to confirm. Return a promise from onConfirm to show the busy state until it ends.
send-payment.tsx
SwipeToConfirm
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| size | "default""lg""xl" | — | |
| tone | "destructive""neutral""success" | — | |
| children | ReactNode | — | |
| on | — | Runs when the knob reaches the end (a release past the threshold, Enter, Space, or a swipe.confirm the app sends to the actor). Return a promise to show pending until it settles: it resolves to done and rejects to error. Show the reason of an error yourself (a Toast). | |
| status | "done""error""idle""pending" | — | The status (controlled). Set it from onStatusChange, or the knob goes back. |
| default | "done""error""idle""pending" | — | The status at first (uncontrolled). |
| on | — | ||
| disabled | boolean | — | No drag, no key; the knob leaves the Tab order. |
| threshold | number | — | The share of the travel (0 to 1) that a release must reach to confirm. Default 0.9. |
| reset | number | — | Back to idle this many ms after done (a control that can run again). |
| glow | boolean | — | A soft halo in the tone color that grows with the fill (glow, @gelatin-ui/glow). Default: false. |
| driver | — | Drives a slide from code (DragDriver, no item): a staged scene or a test grabs the knob, carries it, and lets go, and the release rules (the threshold) confirm or send it back. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SwipeToConfirmThumb
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| children | ConfirmContent | — | The icon at rest (default: a chevron that points to the end). A function of the status gives each status its own icon; where it returns null, the status keeps its built-in icon (the spinner of pending, the check of done, the chevron). |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SwipeToConfirmLabel
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| children | ConfirmContent | — | The text at rest ("Slide to pay"). The other statuses show statusText. A function of the status gives every state its own text instead ("Slide to pay", "Paying", "Paid", "Payment failed. Slide to try again"). A change fades the old text out and the new one in. |
| status | — | The text of pending, done, and error for a plain children text. Defaults (English): "Confirming", "Confirmed", "Could not confirm. Retry". Pass the words of your language. | |
| shimmer | boolean | false | A band of light that sweeps across the text (@gelatin-ui/shimmer), not when done. |
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
| EnterorSpace | On the knob: confirms with no drag. |
|---|
Built with
Installs with Swipe to Confirm
- Components
- Spinner









