Common questions
When should I use a native dialog element?
When you need a modal overlay with focus management and Escape to close. Prefer dialog or popover before building custom overlays with divs and tabindex hacks.
Should every modal trap focus?
Modal dialogs should trap focus while open and restore focus to the trigger on close. Non-modal panels may not need a trap — do not trap by default everywhere.
When is a full page better than a modal?
Long forms, multi-step flows, and content users may bookmark or share are usually better as dedicated routes than cramped overlays.