Skip to main content
Pricing

Confirmation Dialog

Pro

A modal variant specifically designed for confirming destructive or irreversible actions before execution. Features a clear warning message, a description of consequences, and two distinct actions: a danger-styled confirm button and a safe cancel button. The confirm button label should describe the specific action — "Delete project" not "OK". Default focus lands on the cancel button to prevent accidental confirmation.

6 variants

Delete project?
This action cannot be undone. All data will be permanently removed.
Cancel
Delete

Variants

VariantDescriptionWhen to use
Default
DangerRed-toned confirmation for destructive actions like delete or revoke.Use for delete, revoke, remove, or permanently destructive operations.
With Input

Usage Guidelines

Do

Clearly describe what will happen if the user confirms the action.

Don't

Use generic labels like "OK" and "Cancel" — be specific about the action.

Do

Use specific button labels — "Delete project" not just "OK".

Don't

Require confirmation for routine, easily reversible actions.

Do

Focus the cancel/safe action by default, not the destructive one.

Don't

Auto-dismiss the dialog on a timer — the user must explicitly choose.

Do

Trap focus within the dialog and return focus on close.

Don't

Place the destructive action on the left — it should be on the right (trailing position).

Code

This component is included in Lexicon Pro

From €149 — one-time purchase, lifetime access

View pricing

Design Tokens

This component is included in Lexicon Pro

From €149 — one-time purchase, lifetime access

View pricing

Accessibility

  • Use role="alertdialog" with aria-modal="true" — this signals urgency to assistive tech.
  • Provide aria-labelledby pointing to the title and aria-describedby pointing to the description.
  • Focus must be trapped within the dialog.
  • On open, focus should move to the cancel/safe button, not the destructive action.
  • On close, return focus to the element that triggered the dialog.
  • Escape key should trigger the cancel action, not the confirm action.
  • Clear destructive action labelling — button text must describe the action.

Keyboard Interactions

TabMoves focus between the Cancel and Confirm buttons.
Shift + TabMoves focus back to the previous button.
Enter/SpaceActivates the focused button.
EscapeCancels the action and closes the dialog.