Dialog
An accessible modal with focus trap, scroll lock, and inert background.
Basic Dialog
Click the button to open the dialog. While open, focus is trapped inside the
panel, body scroll is locked, the rest of the page is marked inert,
and Escape or clicking the backdrop closes it. Focus is returned to the
opener button on close.
Confirmation (no backdrop dismiss)
Set DismissOnClick="false" on the backdrop and
DismissOnEscape="false" on the panel to require an explicit
choice. Useful for destructive actions.
With form fields
The dialog also works as a focusable form container. Tab cycles between the inputs and buttons; the focus trap keeps them all reachable while keeping the background untouchable.