Skip to content

AlertDialog

Ask for an explicit decision and initially focus the safer action.

alpina-ui/interactive/alert-dialog

Interactive preview

Archive this draft?

The poster will move from the print queue to the archive.

Draft in print queue.

Usage notes

Give the confirmation a specific action label. Initial focus goes to Cancel. Clicking the backdrop leaves the decision open.

When to use

Ask for an explicit decision before deleting a record or discarding work that cannot be recovered.

When to avoid

Routine saves and reversible display changes can proceed without interrupting the person.

Accessibility

State the consequence in the description. Keep the safe action reachable and return focus sensibly after cancellation or deletion.

Keys
KeyAction
Enter / SpaceOpen the confirmation from its trigger. Initial focus goes to Cancel.
Tab / Shift+TabMove between actions within the modal.
EscapeCancel and return focus to the trigger.

Content

Name the object in the question and use an unambiguous verb for confirmation. Keep the consequence to one plain sentence.

Use
Delete draft invoice 104? / Delete draft
Avoid
Are you sure? / Yes

Copy in four languages

German
Entwurf löschen15 characters
French
Supprimer le brouillon22 characters
Italian
Elimina bozza13 characters
Romansh
Stizzar il sboz15 characters
Add to your project
npx --no-install alpina add alert-dialog