# Hold delete

A destructive button you hold until its dithered segments lock.

Also called: hold to delete, hold to confirm delete.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: A delete you have to mean. Hold and the dithered segments charge with a countdown; let go early and it springs back, hold to the end and every segment locks in a ripple. Preview: https://chatcn.dev/preview/hold-delete-demo

The button's face is a bar of segments drawn in dithered cells. Holding charges them left to right, each one flashing as it lights and the lit part crawling in two tones, while the label counts the seconds down. In the last quarter the button trembles a little. Let go early and the charge springs back. Hold to the end and every segment locks solid in a ripple, and the label becomes a drawn check.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/hold-delete
```

## Usage

```tsx
import { HoldDelete } from "@/components/ui/chatcn/pro/hold-delete"

<HoldDelete onConfirm={() => deleteProject(id)} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `onConfirm` | `() => void` | When the hold completes |
| `holdMs` | `number` | Default 1500 |
| `done` | `boolean` | Turn off to drain it and arm it again |
| `label` / `doneLabel` | `ReactNode` |  |
| `segments` | `number` | Default 18 |

## Keyboard

| Key | Action |
| --- | --- |
| Hold `Space` or `Enter` | Charge it |

## Accessibility

- A real button; the countdown and the result are announced.

## Motion

- Lock ripples 22 ms per segment; release springs back. Reduced motion: no crawl or tremble.

Source: https://chatcn.dev/docs/components/hold-delete