ComponentsAlert dialog
Alert dialog
Require an explicit decision before a consequential action.
Setup
Download the shared Inlay assets once. Then choose HTML, React, or Vue and copy the example above.
Discard unsaved changes
Give people the choice to return to editing before discarding their work.
Usage
| Focus | The least destructive action is the initial focus target. Escape dismisses the alert dialog and returns focus to its trigger. |
|---|---|
| Semantics | Use a native dialog with role="alertdialog", an accessible title and a description that explains the consequence. |
| Confirmation | Listen for the close event and inspect returnValue for confirm. The preview never deletes data. |