Black Friday: 30% off Pro

Get 30% off

Updated

Hold to Confirm

Preview

Customize

Sweep
Color
Medium
Duration1.2s
Reset after1.6s
Radius14px

Installation

npx shadcn@latest add https://uibrik.com/r/hold-to-confirm.json
Adds the files to components/uibrik/hold-to-confirm and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/hold-to-confirm.

Usage

import { HoldToConfirm } from "@/components/uibrik/hold-to-confirm/hold-to-confirm";​<HoldToConfirm  label="Hold to delete"  doneLabel="Deleted"  fill="sweep"  color="#dc2626"  size="md"  icon  duration={1.2}  resetAfter={1.6}  radius={14}  onConfirm={() => {}}/>

Where to use Hold to Confirm

  • Deleting accounts and data

    Holding the button down makes a destructive action deliberate without a second dialog.

    Pairs with Inline Confirm

  • Admin danger zones

    A fill that drains back if released early prevents accidental resets and wipes.

    Pairs with Settings Page

  • Payments and transfers

    A held confirmation suits money movement where a slip of the finger is costly.

    Pairs with Amount Pad

Props

HoldToConfirm
label
Type string
"Hold to delete"
Shown while waiting for a hold.
doneLabel
Type string
"Deleted"
Shown once the hold completes.
fill
Type "sweep" | "rise" | "center"
"sweep"
How the fill grows while held: left to right, bottom to top, or out from the middle.
color
Type string
"#dc2626"
Colour of the fill.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
icon
Type boolean
true
Show the trash and check icons beside the labels.
duration
Type number
1.2
How long the button must be held.
resetAfter
Type number
1.6
How long the done state shows before re-arming.
radius
Type number
14
Corner radius.
onConfirm
Type () => void
–
Called once the hold completes.
className
Type string
–
Classes for the button.