shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Destructive
Destructive with Custom Styled Buttons Alert Dialog for React
A destructive dialog with labels that name each outcome and an icon on the destructive action.
Removing a person deserves more signals than a generic Remove. This React alert dialog repeats an X icon in the title and on Remove Member, and labels the safe choice Keep Member. It's shadcn.io's Alert Dialog on Base UI, styled entirely with the action's destructive variant rather than custom colors.
Preview
Installation
FAQ
Why an X icon instead of a trash can?
X means remove or exclude, which fits people and access. A trash can means destroying data. A user-minus icon works for members too.
Is an icon in both the title and the button too much?
For removing people, the repetition is a safeguard: removing the wrong person is costly. For routine deletions one icon is enough.
Why Keep Member instead of Cancel?
It states the safe outcome: the member stays. Cancel only says the dialog closes.
How is the destructive button styled?
With variant="destructive" on AlertDialogAction and the icon marked data-icon="inline-start". The variant follows the theme, so there's no need for raw color classes.
Related
- Delete Confirmation with Icon Alert DialogA delete confirmation with a trash icon
- Confirmation with Custom Button Labels Alert DialogA confirmation dialog whose buttons name
- Actions with Icons Alert DialogAn alert dialog whose action carries an
- Simple Delete Confirmation Alert DialogA simple delete confirmation with a
- Button with Text (Destructive)Delete, in the danger color
- Destructive with Warning Badge Alert DialogA destructive dialog with a Permanent