Skip to content

Drawer

Built on Samla’s Dialog, so it opens as a modal dialog with focus trapping, Escape to close and a backdrop that closes on click. Any element with data-dialog-open="<id>" opens it, and the header has a close button. It slides in from its edge; under reduced motion it appears without the slide.

On this page

Elements, components and sections, one link each.

  • id: dialog id, matched by data-dialog-open (required)
  • title: heading at the top of the panel (required), also the dialog’s accessible name
  • placement: end (default) or start
  • Default slot: the scrolling body
  • footer slot: pinned to the bottom, for totals and actions
<Button data-dialog-open="contents">Contents</Button>
<Drawer id="contents" title="On this page">
<p>Links to each part of the page.</p>
<Button slot="footer" href="/docs/">Read the docs</Button>
</Drawer>
placement="start", used for filters

Filters