Command Palette

Search for a command to run...

Components/Buttons/Hold Button

Hold Button

Buttonsinline sandbox

A confirmation button that fills up while being held, perfect for destructive or irreversible actions. Prevents accidental clicks by requiring a sustained press.

hold button
hold to confirm
confirmation button
destructive button
delete button

Preview

Installation

Use the shadcn CLI to install this component:

npx shadcn@latest add https://messyui.dev/r/hold-button.json

Props

PropTypeDefaultDescription
labelstring"Hold to Delete"Text shown initially on the button
holdingLabelstring"Keep holding..."Text shown while the button is being held
completedLabelstring"Deleted!"Text shown after the action completes
holdDurationnumber1500Duration in milliseconds to hold before action triggers
variant"destructive" | "warning" | "default""destructive"Visual style variant of the button
size"sm" | "md" | "lg""md"Size of the button
disabledbooleanfalseWhether the button is disabled