Ashish Sharma

Hold to Confirm Button

Buttons

About

A press-and-hold button for destructive or irreversible actions that fills with a countdown as you hold it down and drains back if released early, instead of interrupting with a confirmation dialog.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Hold to Confirm Button to your project and fits it to your theme.

Code

How Hold to Confirm Button is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

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

export default function HoldToConfirmDemo() {
  return (
    <div className="flex min-h-[320px] w-full items-center justify-center bg-background">
      <HoldToConfirm
        label="Hold to revoke key"
        doneLabel="Key revoked"
        onConfirm={() => {
          console.log("Key revoked");
        }}
      />
    </div>
  );
}

More by Ashish Sharma

View all
  • Perspective Gallery

    Perspective Gallery

    149
  • Bento Features

    Bento Features

    27
  • Animated Sidebar

    Animated Sidebar

    25
  • Otp Input

    Otp Input

    25
  • Glow Ring

    Glow Ring

    20
  • Notification Stack

    Notification Stack

    11
  • Expandable Tabs

    Expandable Tabs

    11
  • Voice Orb

    Voice Orb

    8

More in Buttons

View all
  • Button

    Button

    169
  • Texture Button

    Texture Button

    122
  • HeroUI Button Group

    HeroUI Button Group

    1
  • Button

    Button

    88
  • Native Button

    Native Button

    7
  • Button

    Button

    74
  • Button Group

    Button Group

    1
  • Button Group

    Button Group

    5

Explore more

Part of Caliper UI — browse the full library on 21st.dev.