Skip to content

    Browse components

    Hold To Confirm

    Destructive action guard: press and hold until the bar fills. Works with Space and Enter.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/hold-to-confirm

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/hold-to-confirm.json

    Usage

    import { HoldToConfirm } from "@/components/ui/hold-to-confirm";
    
    <HoldToConfirm onConfirm={() => deleteProject(id)} />

    Props

    PropTypeDefaultDescription
    durationnumber1500Ms the button must be held.
    labelstring"Hold to delete"Idle label.
    confirmedLabelstring"Deleted"Label after confirming.
    colorstring"#ef4444"Fill color.
    onConfirmReactNode—Called once the hold completes.
    classNamestring—Extra classes for the root element.