Skip to content
Components

Dropdown

Click-to-open menu built on `<details>` — closes on outside click and Escape automatically.

Actions ▾
Account
Profile Settings
html
<details class="b-dropdown">
  <summary class="b-btn b-btn-secondary">Actions ▾</summary>
  <div class="b-dropdown-menu">
    <a href="#">Profile</a>
    <a href="#">Settings</a>
    <hr>
    <button>Sign out</button>
  </div>
</details>

With sections

Open menu
Status

Account
Profile Sign out

Behavior

Without JS, <details> opens on click. The bundled JS adds:

  • Escape closes the menu and returns focus to the trigger
  • Outside click closes the menu

API

| Class | Effect | | --- | --- | | .b-dropdown | Wrapper (use a <details> element) | | .b-dropdown-menu | The popup panel | | .b-dropdown-label | Section label inside the menu |

Edit this page