Drawer Component

A right-side drawer built on the native popover API. No JavaScript, and the browser supplies Escape, outside-click dismissal and focus return.

Interactive Example

Activate the button to slide the panel in. Close it with the close button, Esc, or a click outside.


Example Code
<div>
  <button type="button" class="btn btn-small" popovertarget="demo-drawer">Open Drawer</button>

  <aside id="demo-drawer" popover class="drawer-panel" role="dialog" aria-label="Filters">
    <header class="drawer-header">
      <h3>Filters</h3>
      <button type="button" class="drawer-close" popovertarget="demo-drawer" popovertargetaction="hide" aria-label="Close">&times;</button>
    </header>
    <form>
      <label>Keyword
        <input type="text" placeholder="Search..." />
      </label>
      <label>Status
        <select>
          <option>Any</option>
          <option>Active</option>
          <option>Inactive</option>
        </select>
      </label>
      <footer class="actions">
        <button type="submit" class="btn btn-small">Apply</button>
      </footer>
    </form>
  </aside>
</div>