shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Destructive
Destructive with Item Count Alert Dialog for React
A destructive dialog that names how many items will be deleted, in the title and on the action.
Deleting one item feels different from deleting 24. This React alert dialog repeats the count in the title, the description and the Delete 24 Items action, and adds a warning panel about references. It's shadcn.io's Alert Dialog on Base UI.
Preview
Installation
FAQ
Where should the count appear?
Everywhere people look before confirming: the title, the description and the action label. The repetition is the safeguard against deleting more than intended.
How do I handle one item?
Pluralize from the count: Delete 1 Item?, not Delete 1 Items?. The demo's 24 is static text; build the strings from your selection.
When should a bulk delete need more confirmation?
As the count grows, so should the friction: add a checkbox or type-to-confirm for large deletions, as in Destructive with Checkbox Confirmation.
How is the warning panel styled?
A rounded-md border panel with border-destructive/20 bg-destructive/5, and the word Warning in text-destructive. Use it for knock-on effects people may not expect, like references from other resources.
Related
- Simple Delete Confirmation Alert DialogA simple delete confirmation with a
- Destructive with Consequence Details Alert DialogA destructive dialog that lists what
- Destructive with Warning Badge Alert DialogA destructive dialog with a Permanent
- Simple Confirmation Dialog Alert DialogA simple confirmation dialog with Cancel
- Destructive with Checkbox Confirmation Alert DialogA destructive dialog whose delete action
- Delete Confirmation with Icon Alert DialogA delete confirmation with a trash icon