Hold Button
hold-buttonPress and hold to confirm, with a fill that sweeps across while you hold and drains back if you let go early. For actions too serious for one click and too small for a dialog. Space and Enter hold it from the keyboard.
"use client";
import { Check, KeyRound, PhoneOff } from "lucide-react";
import { useState } from "react";
import { HoldButton } from "@/components/forme/hold-button/hold-button";
export function HoldButtonDemo() {
const [log, setLog] = useState("Press and hold a button.");
return (
<div className="flex flex-col items-start gap-4">
<div className="flex flex-wrap gap-3">
<HoldButton
onConfirm={() => setLog("API key revoked.")}
doneLabel={
<>
<Check aria-hidden /> Revoked
</>
}
>
<KeyRound aria-hidden /> Hold to revoke key
</HoldButton>
<HoldButton
variant="primary"
duration={900}
onConfirm={() => setLog("Call ended for everyone.")}
doneLabel={
<>
<Check aria-hidden /> Ended
</>
}
>
<PhoneOff aria-hidden /> End for all
</HoldButton>
</div>
<p aria-live="polite" className="text-caption-1-regular text-muted-foreground">
{log}
</p>
</div>
);
}Install
Adds the component, its registry dependencies, and the token stylesheet you import once.
Usage
import { HoldButton } from "@/components/forme/hold-button/hold-button";
<HoldButton onConfirm={revokeKey} doneLabel="Revoked">
Hold to revoke
</HoldButton>When to use
Reach for it
- Actions too serious for one click and too small for a dialog: revoking a key, ending a call for everyone.
Use something else
- Anything a person does often; holding for over a second every time gets old fast.
- Irreversible actions at scale, which deserve a dialog that asks for the name.
API reference
Read from the source, so it is the API of the file you install. A prop marked * is required.
HoldButton
Press and hold to confirm. The fill sweeps across while the press lasts; let go early and it drains back.
| Prop | Type | Default | Description |
|---|---|---|---|
children* | ReactNode | — | |
onConfirm* | () => void | — | |
duration | number | 1200 | Milliseconds the press must be held. |
doneLabel | ReactNode | "Done" | Label shown once confirmed, before it resets. |
variant | "danger" | "primary" | "danger" | |
disabled | boolean | — | |
className | string | — |
Accessibility
- Space and Enter hold it from the keyboard, and the instruction to hold is in its accessible description.
Motion
- A fill sweeps across for
duration, 1200ms by default, and drains back if you let go early.
Related


Button
The primary action element. Four variants and three sizes, gradient primaries that crossfade on hover rather than snap, and an icon contract where the button owns the icon size. No client boundary, so it works in a server component and ships no JavaScript.
buttons

Theme Toggle
A sun that sets into a crescent moon, and the new theme revealed from the button with a View Transition: a circle, a soft-edged spill or a shutter, measured to the farthest corner. No theme library, no flash, and a setTheme you can call from anywhere.
buttons

Confirm Button
A destructive button that grows into its own confirmation on a spring, so the question appears where you are looking. Focus lands on Cancel, Esc or clicking away disarms it, and the confirm button shows a spinner while the action runs.
motion