ThatDesignUIOriginalInteractive preview
Hold to confirm button
A destructive action that only happens if you press and hold: red fills the button left to right, letting go early drains it back.
- 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/hold-to-confirm-button.json2. Use it
Every prop is optionalapp/page.tsx
import HoldToConfirmButton from "@/components/hold-to-confirm-button";
export default function Page() {
return <HoldToConfirmButton />;
}Prefer to paste it yourself? Open the .
Under the hood
How it’s built
What’s inside
- A 56px white button with a 2px red (#dc2626) border and red text, at least 16rem wide, with a one-line hint underneath saying how long to hold.
- While held (pointer, Enter or Space) a red fill grows from the left over the hold time; the label turns white past halfway.
- Completing the hold shows the done label with a check for two seconds, then resets; releasing early drains the fill in 250ms.
How it behaves
- A quick click does nothing; only a full hold confirms.
- Holding Enter or Space works the same as holding the pointer, and releasing cancels.
- The label and the result are announced, and the hint is linked with aria-describedby.
- Moving the pointer off the button while holding cancels.



