shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Destructive
Destructive with Warning Badge Alert Dialog for React
A destructive dialog with a Permanent Action badge under the title.
Sometimes a red button isn't enough of a speed bump. This React alert dialog puts a Permanent Action badge between the title and the description of a Clear All Data warning. It's shadcn.io's Alert Dialog on Base UI with a destructive Badge and a database icon in the title.
Preview
Installation
FAQ
Why put the badge between the title and the description?
The title says what, the badge says how serious, and the description explains. Placed there, it's read before the details and in that order by screen readers.
What should the badge say?
Two or three direct words: Permanent Action, Cannot Be Undone. Generic words like Caution don't say what's special about the action.
How is the badge styled?
It's a Badge with variant="destructive" and pill, so it follows the theme's destructive color with no extra classes.
When does a badge add something a red button doesn't?
When the action is more than destructive: permanent, immediate, or affecting a lot of data. A routine file deletion doesn't need one.
Related
- Delete Confirmation with Icon Alert DialogA delete confirmation with a trash icon
- Destructive with Consequence Details Alert DialogA destructive dialog that lists what
- Badge with Text (Destructive)A destructive badge for an error, a
- Destructive with Checkbox Confirmation Alert DialogA destructive dialog whose delete action
- Simple Confirmation Dialog Alert DialogA simple confirmation dialog with Cancel
- Destructive with Custom Styled Buttons Alert DialogA destructive dialog with labels that