Skip to content
Flat Meet

Dialog

Overlays

A modal on the browser's <dialog>: the rest of the page is inert while it is open, focus moves inside, Escape or a click on the backdrop closes it, and focus returns to the button that opened it.

Source

src/components/ui/Dialog.tsx
View in Storybook

Usage

Confirm a delete

Guidelines

  • Render it only while open
  • Mark the field that should take focus first with data-autofocus
  • For a delete, focus Cancel first