Modal Dialog Component Example

This example shows a modal that is closed by default. Click the button below to open it.

The open button has the class "trigger". Modal supports ESC to close, clicking the overlay to close, and focus trapping.

Page content

Some page content behind the modal. When the modal opens, keyboard focus is moved into it and returned to the trigger when it closes.

Example link