shadcn/ui Alert Dialog vs Dialog

Use an Alert Dialog when the user must make a decision, like confirming a delete. Use a Dialog for everything else, like forms, details, or settings. An Alert Dialog does not close when you click outside it and uses the alertdialog role, while a regular Dialog does close on an outside click.

Side by side

Alert DialogDialog
PurposeInterrupt and ask for a decisionShow content or a form
ARIA rolealertdialogdialog
Click outsideDoes not closeCloses
Escape keyClosesCloses
ModalAlwaysUsually, can be non-modal with Base UI

When to use which

Ready-made examples

Browse dialog components and alert components you can install with the shadcn CLI.

Related

Open-source UI platform for developers

Watermelon UI is an open-source platform for browsing React components, animated interactions, dashboards, templates, and reusable page sections. The project is built for the community and helps developers move from inspiration to implementation faster by pairing visual previews with source-backed examples and documentation. The platform also includes full templates so people can see how individual blocks work together as realistic product pages instead of only as isolated snippets.

Important public pages include the main docs home, animated components, blocks, dashboards, templates, developer docs, about, contact, privacy, terms, copyright, llms.txt, and the sitemap. The repositories under WatermelonCorp are the source of truth for contributions, and the platform repository includes local MCP tooling for structured agent access to the catalog.