A sheet dialog is a modal dialog

Sheets are functionally the same as a modal dialog. The only reason there’s an entry for this is because people call it a sheet.

Variations

(Spoiler alert: These all have the same rules.)

Code examples

Dialog sheet using JS (Do NOT use Popover API)

<button id="showModal">
  Things you should know
</button>

<dialog role="dialog"
        id="modal"
        tabindex="-1"
        aria-modal="true"
        aria-labelledby="dialog-title"
        class="bottom-sheet">
  <button type="button"
          id="closeModal"
          class="close">
    <span class="hidden">Close</span>
  </button>
  <div class="dialog-content">
    <h2 id="dialog-title" class="h-bravo">
      Things you should know
    </h2>
    <h3>Keyboard</h3>
    <ul>
      <li>Focus must not enter the rest of the page.</li>
      <li>The escape key must close the modal.</li>
    </ul>
    <h3>Screenreader</h3>
    <ul>
      <li>The modal's title is announced on launch.</li>
      <li>The screen reader cannot read content behind the dialog.</li>
    </ul>
    <button type="submit">
      Continue
    </button>
  </section>
</dialog>

Things you should know

Keyboard

  • Focus must not enter the rest of the page.
  • The escape key must close the modal.

Screenreader

  • The modal's title is announced on launch.
  • The screen reader cannot read content behind the dialog.

Related dialog sheet entries