# Hold to Confirm

> A destructive-action button that has to be held down; a fill grows across it and drains back if released early.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Buttons |
| Live preview | https://uibrik.com/components/hold-to-confirm |
| Writes | 1 file into `components/uibrik/hold-to-confirm/` |
| Packages | `@tabler/icons-react`, `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/hold-to-confirm.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/hold-to-confirm`.

Can't run commands? https://uibrik.com/components/hold-to-confirm/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { HoldToConfirm } from "@/components/uibrik/hold-to-confirm/hold-to-confirm";

<HoldToConfirm
  label="Hold to delete"
  doneLabel="Deleted"
  fill="sweep"
  color="#dc2626"
  size="md"
  icon
  duration={1.2}
  resetAfter={1.6}
  radius={14}
  onConfirm={() => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/hold-to-confirm.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `label` | `string` | `"Hold to delete"` | Shown while waiting for a hold. |
| `doneLabel` | `string` | `"Deleted"` | Shown once the hold completes. |
| `fill` | `"sweep" \| "rise" \| "center"` | `"sweep"` | How the fill grows while held: left to right, bottom to top, or out from the middle. |
| `color` | `string` | `"#dc2626"` | Colour of the fill. |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Height, padding and text size. |
| `icon` | `boolean` | `true` | Show the trash and check icons beside the labels. |
| `duration` | `number` | `1.2` | How long the button must be held. |
| `resetAfter` | `number` | `1.6` | How long the done state shows before re-arming. |
| `radius` | `number` | `14` | Corner radius. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `onConfirm` | `() => void` |  | Called once the hold completes. |
| `className` | `string` |  | Classes for the button. |

## Where it fits

- **Deleting accounts and data**: Holding the button down makes a destructive action deliberate without a second dialog. Pairs with [Inline Confirm](https://uibrik.com/components/inline-confirm.md).
- **Admin danger zones**: A fill that drains back if released early prevents accidental resets and wipes. Pairs with [Settings Page](https://uibrik.com/components/settings-page.md) (Pro).
- **Payments and transfers**: A held confirmation suits money movement where a slip of the finger is costly. Pairs with [Amount Pad](https://uibrik.com/components/amount-pad.md).

## Same shelf: Buttons

- [Inline Confirm](https://uibrik.com/components/inline-confirm.md): A destructive button that splits into Cancel and Confirm in its own footprint, so nothing around it moves.
- [Mesh Button](https://uibrik.com/components/mesh-button.md) (Pro): A button painted with a softly blended mesh gradient under rolling silk waves that catch a satin sheen; the pointer presses into the silk and a click ripples it.
- [Prism Button](https://uibrik.com/components/prism-button.md) (Pro): A graphite button with a border of polished metal that splits light like a prism; the glint travels round the border and turns to follow the pointer.
- [Share Menu](https://uibrik.com/components/share-menu.md): A share button that flips open into a pill of options, resizing to fit.
- [Soft Button](https://uibrik.com/components/soft-button.md): A plain button made with care: a gentle top-to-bottom gradient, a faint inner highlight and shade, and a crisp border, in primary, secondary and accent.
- [Split Button](https://uibrik.com/components/split-button.md): A primary button with a menu of alternative actions; the chosen one rolls into the main label.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/hold-to-confirm/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
