Saurabh

Hold Action Button

Buttons 34

About

A press-and-hold button that fills with a liquid animation to confirm a destructive or important action, cancelling if released early.

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

Code

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

Usage.tsx

"use client";

import HoldActionButton from "@/components/ui/hold-action-button";
import { useState } from "react";

export default function HoldActionButtonPreview() {
  const [confirmed, setConfirmed] = useState(false);

  return (
    <div className="flex flex-col items-center justify-center gap-3">
      <HoldActionButton
        onHoldComplete={() => {
          setConfirmed(true);
          window.setTimeout(() => setConfirmed(false), 1800);
        }}
      >
        Hold for vertical fill
      </HoldActionButton>
      <HoldActionButton
        type="horizontal"
        onHoldComplete={() => {
          setConfirmed(true);
          window.setTimeout(() => setConfirmed(false), 1800);
        }}
      >
        Hold for horizontal fill
      </HoldActionButton>
      <p className="h-4 text-xs text-muted-foreground" aria-live="polite">
        {confirmed ? "Action confirmed" : "Release early to cancel"}
      </p>
    </div>
  );
}

Dependencies

More by Saurabh

View all
  • BeUI Tilt Card

    BeUI Tilt Card

    374
  • BeUI Expandable Tabs

    BeUI Expandable Tabs

    352
  • BeUI File Upload

    BeUI File Upload

    297
  • Animated Sidebar

    Animated Sidebar

    211
  • BeUI Bouncy Accordion

    BeUI Bouncy Accordion

    207
  • BeUI Create Menu

    BeUI Create Menu

    200
  • BeUI Expanable Action Bar

    BeUI Expanable Action Bar

    196
  • Loader

    Loader

    190

More in Buttons

View all
  • Texture Button

    Texture Button

    98
  • Button

    Button

    1
  • Button

    Button

    68
  • Eclipse Button

    Eclipse Button

    3
  • Button

    Button

    65
  • App Store Button

    App Store Button

    459
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Base Button

    Base Button

    4

Explore more

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