Hold to Confirm Button

A hold to confirm button that fills while held and fires only when the hold completes.

Installation

Adds the component and everything it depends on to your project.

npx shadcn add https://ui.beste.co/component/r-base/button14

New here? Read the installation guide.

Usage

The import and the props worth knowing about, in one place.

import { Button14 } from "@/components/beste/component/button14";
import { LogOut } from "lucide-react";

// onConfirm fires only after the button is held for holdDuration ms.
// Releasing early cancels and snaps the fill back.
<Button14
  label="Hold to delete"
  confirmLabel="Deleted"   // shown once the hold completes
  onConfirm={() => console.log("deleted")}
/>

<Button14
  label="Hold to sign out"
  confirmLabel="Signed out"
  icon={LogOut}        // idle icon (default: Trash2)
  tone="dark"          // "destructive" (default) | "dark" | "primary"
  rounded="md"         // "full" (default) | "lg" | "md" | "none"
  holdDuration={800}   // ms the button must be held
  resetDelay={0}       // 0 keeps the confirmed state (no auto-reset)
  onConfirm={() => console.log("signed out")}
/>

Playground

Turn the props on the right; the snippet under them is what you would write to get what you see.

Usage
import { Button14 } from "@/components/beste/component/button14";

<Button14
  label="Hold to delete"
  confirmLabel="Deleted"
/>

Keyboard and gestures

Every one of these is in the component already. They are listed because a props table cannot mention a gesture, so nothing else on this page can tell you they exist.

Press and holdThe fill crosses the button over `holdDuration`; only when it lands does `onConfirm` run.
Release earlyThe fill runs back and nothing is confirmed. That is the whole point of the control.
Space / Enter heldHolds the same way, so the keyboard is not offered a shortcut past the pause.

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
label*stringIdle label (e.g. "Hold to delete")
confirmLabelstringLabel shown once the hold completes
holdDurationnumberHow long the button must be held, in ms
resetDelaynumberHow long the confirmed state is shown before resetting, in ms; 0 disables the reset
iconLucideIconLeading icon in the idle state (defaults to Trash2)
tone"destructive" | "dark" | "primary"Fill tone: destructive (default), dark, or primary
rounded"full" | "lg" | "md" | "none"Corner radius (defaults to full)
onConfirm() => voidCalled once, when the hold completes
classNamestringAdditional classes merged onto the button

More Button components

View all Button

Async Loading Button

An async loading button that shows a spinner and disables itself while a promise resolves.

Play Button

A video play button with a circular play seal, label, and duration for showreels and product demos.

Expanding Reveal Button

An expanding icon button that reveals its label on hover or focus for compact layouts.

Avatar Stack Button

A social proof button with an avatar stack inside the pill and a trailing arrow.

Magnetic Button

A magnetic button that is pulled toward the cursor on hover and springs back on leave.

Seal Arrow Button

An uppercase pill button with a trailing seal arrow chip and an optional link.

Markdown version