ThatDesignUIOriginalInteractive preview
Swipe to confirm
A payment-style slider: drag the knob along the track to confirm, it snaps back if you stop short, and arrows or Enter work from the keyboard.
- Category
- Buttons
- Platform
- Responsive
Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.Default state
Use this component
Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.
FreeReact 18+Tailwind v3.4 or v4No extra packages
1. Add it with the shadcn CLI
npx shadcn@latest add https://www.thatdesignui.com/r/swipe-to-confirm.json2. Use it
Every prop is optionalapp/page.tsx
import SwipeToConfirm from "@/components/swipe-to-confirm";
export default function Page() {
return <SwipeToConfirm />;
}Prefer to paste it yourself? Open the .
Under the hood
How it’s built
What’s inside
- A 304px by 56px dark navy track, fully rounded, with a centred white label and a 48px white knob holding an arrow at the left.
- Dragging moves the knob 1:1 with the pointer and fades the label; past 85% it snaps to the end, the track turns green and the label becomes the done label with a check in the knob.
- Short of 85% it springs back with a slight overshoot; it resets 2.5 seconds after confirming.
How it behaves
- Dragging past 85% confirms; releasing earlier springs back.
- The knob is a slider with aria-valuenow; Left/Right move it a fifth of the way, Enter or Space confirm.
- Touch dragging doesn't scroll the page.
- The done label is announced.



