uibrik

Hold to Confirm

Preview

Customize

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

Usage

import { HoldToConfirm } from "@/components/uibrik/hold-to-confirm/hold-to-confirm";

<HoldToConfirm />

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.

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.