Delete (danger)
The risky question: hazard tape across the top corners, a red patch behind the icon, and a hatched destructive answer. Focus starts on Cancel.
A dialog that asks one question and will not go away until it is answered: no close button, no dismissing by clicking outside, focus starts on the safe answer. For risky questions it can be taped with hazard strips and given a red patch behind its icon.
npx shadcn@latest add @wobko/alert-dialogFirst time here? Add the registry to components.json first. How to install
The risky question: hazard tape across the top corners, a red patch behind the icon, and a hatched destructive answer. Focus starts on Cancel.
size="sm": a narrow, centered sheet with the two answers in equal columns. Good for quick confirmations.
The round patch behind the media says what kind of question this is: highlighter for a plain confirmation, sky for information, red pencil for danger.
A confirmation that does real work: the action keeps the dialog open while it runs (preventDefault), disables both answers, then closes it and the page reports the result.
The shadcn demo with no extras: an outline trigger, a title, one paragraph and the two answers. Focus starts on Cancel, Escape closes it, a click on the backdrop does not, and focus returns to the trigger.
The sheet: a Paper that is also the alertdialog. It takes every Radix Content prop and these.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "default" | "sm" | "default" | `sm` is a narrow, centered sheet with the buttons in two equal columns. |
| tone | "default" | "danger" | "default" | `danger` tapes red-and-white hazard strips across the top corners. |
| stock | StockName | "paper" | What the sheet is made of. |
| edge | EdgeSpec | "cut" | Cut (CSS, no svg), torn, deckle, ... |
| tilt | boolean | number | true | Small seeded tilt of the sheet; text stays upright; phones lay it flat. |
| seed | string | number | - | Pins the hand. |
The picture beside the question: put an Icon or a Sticker in it. It sits on a hand-drawn round patch.
| Prop | Type | Default | Description |
|---|---|---|---|
| tone | "default" | "danger" | "info" | "default" | The patch color: highlighter, red pencil wash, sky. |
| seed | string | number | - | Pins the hand. |
The confirming answer. A Button (asChild over Radix Action) that closes the dialog after its onClick.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | ButtonVariant | "default" | Any Button variant; use `destructive` for irreversible actions. |
| size | ButtonSize | "default" | Any Button size. |
The safe answer. A Button that closes the dialog; focus starts here.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | ButtonVariant | "outline" | Any Button variant. |
| size | ButtonSize | "default" | Any Button size. |
The files the CLI copies into your project.
Loading the source