ComponentsAlert dialog

Alert dialog

Require an explicit decision before a consequential action.

Example

Delete this project?

Project notes and attachments will be permanently removed from this workspace.

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.

Example

Discard changes?

Updates made since the last save will be lost.

Usage

FocusThe least destructive action is the initial focus target. Escape dismisses the alert dialog and returns focus to its trigger.
SemanticsUse a native dialog with role="alertdialog", an accessible title and a description that explains the consequence.
ConfirmationListen for the close event and inspect returnValue for confirm. The preview never deletes data.