Skip to content

Swipe to Confirm

Pro

A track with a knob that you drag to the end to confirm an action that is hard to undo, such as a payment. It shows pending, done, and error.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Swipe to Confirm needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
39
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

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>
PropTypeDefaultDescription
size"default""lg""xl"—
tone"destructive""neutral""success"—
childrenReactNode—
onConfirm—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.
defaultStatus"done""error""idle""pending"—The status at first (uncontrolled).
onStatusChange—
disabledboolean—No drag, no key; the knob leaves the Tab order.
thresholdnumber—The share of the travel (0 to 1) that a release must reach to confirm. Default 0.9.
resetAfternumber—Back to idle this many ms after done (a control that can run again).
glowboolean—A soft halo in the tone color that grows with the fill (glow, @gelatin-ui/glow). Default: false.
driverRef—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>
PropTypeDefaultDescription
classNamestring—
childrenConfirmContent—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>
PropTypeDefaultDescription
childrenConfirmContent—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.
statusText—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.
shimmerbooleanfalseA 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.
  • Use it for a payment, a transfer, or a delete that needs a clear gesture.
  • Return a promise from onConfirm to show pending, then done or error.
  • Use tone="destructive" for a delete and tone="success" for a payment.
  • For a normal action that is easy to undo, use a Button.
  • For a step that needs a written reason or a second look, use an Alert Dialog.
EnterorSpaceOn the knob: confirms with no drag.
Release at the end
indicator · the knob slides to the end and the action runs
Release before the end
sheet · the knob slides back to the start
Label swap
fade · the label text fades to the text of the new status
Press
press · the knob steps to the pressed color

Built with

Installs with Swipe to Confirm

Components
Spinner
  1. AddedSwipe to Confirm, with Spinner.
Open the release