Components · Overlays & Dialogs

Dialog

A window that stops the page until people respond.

Automated a11y scan passing Element: <dialog>

Component Workbench

Switch between the live interactive preview, syntax-highlighted implementation code, copyable AI coding agent prompt, and designer anatomy blueprint.

Dialog · Canonical Spec
SYSTEM SPEC

SYSTEM SPEC

The fundamental laws governing the creation of this digital artifact.

CORE RULES
  1. 1.Hide complexity until desired.
  2. 2.Write Compact Helpful copy (max 3 lines, 40–80 chars per line, EL5 mode).
  3. 3.One primary focus at a time.
  4. 4.Design Adaptive always (adapt to any device).
  5. 5.Prioritize Stability > Performance > Usability > Aesthetic.

When to use it

Do

  • Use it for decisions that need full attention.
  • Name the action in the button, such as "Delete project".

Don't

  • Use it for routine messages. Use Toast or Alert instead.
  • Open one dialog on top of another.

Accessibility & Keyboard Interaction

Requirements for using this component accessibly, following the W3C ARIA Authoring Practices Guide.

Interaction / KeyBehavior & Compliance Requirement
Native showModal()Traps focus cyclically inside modal surface.
Escape & ScrimPressing Escape or clicking backdrop closes modal and restores trigger focus.

Tokens

Values update with the current theme.

RoleTokenCurrent value
Surface--as-semantic-color-surface-card
Corner Radius--as-radius-lg
Overlay Shadow--as-elevation-shadow-overlay
Esc
↑↓ navigateEnter openEsc close