Example site

Accessible modal dialog example

This page demonstrates an accessible modal dialog pattern. The dialog is closed by default. The button that opens it has a class of trigger.

Usage notes

  • Open the dialog with the "Open dialog" button (class "trigger").
  • Dialog traps keyboard focus while open, is dismissible with ESC, by clicking the close button, or by clicking outside the dialog content.
  • On close, focus returns to the trigger button.