Hold ButtonFreev1.0.0
For actions that shouldn't happen by accident: press and keep holding until twelve cells fill. Only a full, unbroken hold confirms; let go early and it drains and tells you what's needed. A promise from onConfirm shows it working, then done.
pnpm dlx shadcn@latest add https://beautiful-ui.dev/r/lumen-hold-button.jsonpnpm dlx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/lumen-hold-button.jsonFree, no account or key. Use the command for your project's primitives: a radix-*, new-york or default style in components.json is Radix, a base-* style is Base UI. With the @beautiful-ui registry added, @beautiful-ui/<name> picks for you.
Usage
Import it and pass your content. The props that matter most are listed next.
import { HoldButton } from "@/components/ui/lumen/controls/hold-button";
<HoldButton icon="trash" onConfirm={() => deleteFile(id)} doneLabel="Deleted">
Hold to delete
</HoldButton>Props
motion"full""full" | "subtle" | "off"As on Button: subtle is shorter on a calm curve; off is instant. Reduced motion is respected automatically.
onConfirm–() => unknownRuns after a full hold. Return a promise to show it working; a rejection shows errorLabel.
children–ReactNodeThe label, such as "Hold to delete".
holdMs1200numberHow long the hold takes.
doneLabel / errorLabel"Done" / "Try again"string / ReactNodeAfter the work finishes.
holdingLabel / hintLabel"Keep holding" / "Press and hold to confirm"stringWhile held, and for a moment after letting go too early (also the spoken description).
Show all 8 propsShow fewer
variant / size / icon"destructive"Button propsAs on Button.
onError–(error) => voidReceives the failure.
Source
components/ui/lumen/controls/hold-button.tsx