Alert Dialog
A high-interruption confirmation dialog that pauses workflow before irreversible or critical actions, requiring an explicit decision
Table of Contents
Interactive Playground
Tap or drag to interact with the demoWhat is Alert Dialog?
A high-interruption confirmation dialog that pauses workflow before irreversible or critical actions, requiring an explicit decision. It is a core concept in UI Components within UI / UX.
Core Principles
An Alert Dialog is a high-interruption dialog built strictly for critical, often irreversible decisions. It halts the user's workflow before actions like permanent deletion, discarding unsaved work, or revoking access so the consequences are understood and explicitly confirmed.
Reserve it carefully: overusing confirmation dialogs for reversible actions causes confirmation fatigue, training users to click through blindly. For easily reversible actions, execute immediately and offer an Undo toast instead.
Practical Takeaways
- Replace vague "Yes / No" with specific action verbs: Pair
Cancelwith a concrete verb likeDelete ProjectorDiscard Draftso the outcome is unmistakable even if the user skips the body text. - Set safe initial focus and disable backdrop dismiss: Focus the safe
Cancelaction on open to prevent accidentalEnterconfirmations, trap focus insiderole="alertdialog", and require an explicit button click rather than clicking outside. - Add intentional friction for extreme risk: For catastrophic actions like deleting a production database or repository, require typing the resource name before enabling the destructive button.
Notable Examples
- GitHub repository deletion: Destructive alert dialog requiring the user to type the repo slug to confirm.
- Unsaved changes guard: Prompting
Keep EditingvsDiscard Changeswhen leaving a dirty form. - Subscription cancellation: Summarizing lost benefits and end-of-billing date before finalizing cancellation.