domestic-ui GitHub

Account menu

The signed-in person's name and email, links to their account pages and a sign-out button, in a popover.

Our choice: A disclosure, not an ARIA menu: the items are links and one form button, so a data-popover holding a <nav> keeps Tab order and link semantics; the popover lines its other children up with the links.

Where an account menu is used An account menu opens from the person's name at the end of the header, with their name and email, account links and a sign-out button.

Live example

Account menu

<button type="button" popovertarget="account" data-button="quiet">Maria Santos</button>
<div id="account" popover data-popover>
  <p>
    <strong>Maria Santos</strong><br>
    <span data-text="small muted">maria@northwind.example</span>
  </p>
  <hr>
  <nav aria-label="Account" data-nav>
    <ul>
      <li><a href="#profile">Profile</a></li>
      <li><a href="#billing">Billing</a></li>
      <li><a href="#settings">Settings</a></li>
    </ul>
  </nav>
  <hr>
  <form action="#sign-out" method="post">
    <button type="submit" data-button="quiet">Sign out</button>
  </form>
</div>

Attributes

Keyboard

See the keyboard section of the APG Disclosure pattern.

Accessibility

  • Links that go to other pages are not a menu (menu button explains when a menu fits). Tab moves through the links and the sign-out button.
  • Sign out is a form that posts, not a link, so following or prefetching a link never signs anyone out (HTTP semantics, safe methods).
  • The button's name is the person's name, so it reads as whose account this is.

Specifications

See also

How other systems do it

For comparison only; these are not the standard this system follows.

Search