shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Destructive
Delete Confirmation with Icon Alert Dialog for React
A delete confirmation with a trash icon beside the title and a destructive action.
Red text alone doesn't always register as danger; a trash icon does. This React alert dialog pairs a destructive-colored trash icon with the title and a destructive Delete Project action, so the intent is clear before anyone reads the words. It's shadcn.io's Alert Dialog on Base UI.
Preview
Installation
FAQ
Which icon fits a destructive action?
A trash can for deleting, a warning triangle for risky operations, a user-minus or X for removing people or access. Avoid a bare X for deletion, since it also means close.
Should the icon match the button color?
Yes. The icon uses text-destructive and the action variant="destructive", so the same theme color marks everything dangerous in the dialog.
What size works beside the title?
size-5 balances with the title text. Larger icons crowd the header; smaller ones read as decoration.
Inline or centered above the title?
Inline, as here, for routine deletions. Center a larger icon for the heaviest ones, like closing an account, as Destructive with Checkbox Confirmation does.
Related
- Simple Delete Confirmation Alert DialogA simple delete confirmation with a
- Confirmation with Icon Alert DialogA confirmation dialog with a warning icon
- Destructive with Checkbox Confirmation Alert DialogA destructive dialog whose delete action
- Destructive with Warning Badge Alert DialogA destructive dialog with a Permanent
- Button with Text (Destructive)Delete, in the danger color
- Confirmation with Centered Icon Alert DialogA confirmation dialog with a large icon