Skip to the page
Tactile UI

Kit parts

Dialog

A decision that must be made now: a native dialog with a question, one sentence of consequence, a way back and the act.

On this page
  1. Anatomy
  2. Variants
  3. States
  4. Props and options
  5. Usage notes
  6. Accessibility
  7. Related parts

Seats open in 11 days. Want one email that morning?

Anatomy

The browser’s own dialog, dressed.

Variants

  • Destructive

States

  • Open
  • Destructive
  • Focus on the act

Props and options

NameKindDescription
showModal() · close()methodOpens modally with a backdrop, traps focus, returns it on close.
returnValuepropertyThe value of the key that closed it.
close · canceleventAfter it closes; cancel on Escape.
EscapekeyboardCloses it, as native.

Usage notes

Open it. Escape or “Keep it” closes it; focus returns to the key.

Accessibility

  • Put the flat key first, so the safe choice is reached first.
  • Keyboard: Escape closes a modal dialog, and Tab and Shift+Tab stay on what is inside it, because the page behind is inert. Enter or Space presses the focused key.

Toast

A confirmation after an action.

Key

Every button, and every link that acts like one: a cap on a skirt that drops below the plate when pressed.

Field

Text entry in a recess, the label printed above it, and a hint that says how to fix an error.