Components · Overlays
Dialog
shadcn's Dialog: a modal that traps focus while open and hands it back when it closes.
Installation
npx shadcn@latest add https://www.syntaqx.com/r/dialog.jsonExamples
Focus comes home
Opening a dialog moves focus into it; closing it puts focus back on whatever opened it. Without that, a keyboard user who closes a dialog starts over from the top of the page. Open each with the keyboard and close it with Esc.
Inspired by WAI-ARIA APG