# Menubar

A row of menu titles, as at the top of a desktop app (File, Edit, View), each opening a dropdown menu; the arrow keys move along the bar and from one open menu to the next.

Block: `smbk-menubar`. Status: proposed. Figma: the Figma file, https://www.figma.com/community/file/1688324308358870630. Desktop and mobile: differ by presentation only.

## Options

| Axis | Values | Default | Meaning |
|---|---|---|---|

Parts: `smbk-menubar__item`

## Markup

```html
<div role="menubar" aria-label="Editor" class="smbk-menubar">
  <div class="smbk-dropdown__anchor">
    <button
      type="button"
      class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-sm smbk-menubar__item"
      role="menuitem"
      tabindex="-1"
      id="menubar-1-opener"
      aria-haspopup="menu"
      aria-expanded="false"
      aria-controls="menubar-1-panel"
    >
      <span class="smbk-btn__label">File</span>
    </button>
    <div class="smbk-dropdown__layer">
      <div
        id="menubar-1-panel"
        role="menu"
        aria-label="File"
        class="smbk-dropdown smbk-dropdown--size-md smbk-dropdown--align-start"
        tabindex="-1"
        data-scrollbar=""
        hidden=""
      >
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+N"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-plus smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">New file</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ N</kbd>
        </button>
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+O"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-folder-simple smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Open</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ O</kbd>
        </button>
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+S"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-floppy-disk smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Save</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ S</kbd>
        </button>
        <hr
          class="smbk-divider smbk-divider--orientation-horizontal smbk-dropdown__divider"
          role="separator"
        >
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+Backspace"
          tabindex="-1"
          class="smbk-dropdown__item smbk-dropdown__item--danger"
        >
          <i
            class="ph ph-trash smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Move to trash</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ ⌫</kbd>
        </button>
      </div>
    </div>
  </div>
  <div class="smbk-dropdown__anchor">
    <button
      type="button"
      class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-sm smbk-menubar__item"
      role="menuitem"
      tabindex="-1"
      id="menubar-2-opener"
      aria-haspopup="menu"
      aria-expanded="false"
      aria-controls="menubar-2-panel"
    >
      <span class="smbk-btn__label">Edit</span>
    </button>
    <div class="smbk-dropdown__layer">
      <div
        id="menubar-2-panel"
        role="menu"
        aria-label="Edit"
        class="smbk-dropdown smbk-dropdown--size-md smbk-dropdown--align-start"
        tabindex="-1"
        data-scrollbar=""
        hidden=""
      >
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+Z"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-arrow-counter-clockwise smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Undo</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ Z</kbd>
        </button>
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Shift+Meta+Z"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-arrow-clockwise smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Redo</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⇧ ⌘ Z</kbd>
        </button>
        <hr
          class="smbk-divider smbk-divider--orientation-horizontal smbk-dropdown__divider"
          role="separator"
        >
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+X"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-scissors smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Cut</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ X</kbd>
        </button>
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+C"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-copy smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Copy</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ C</kbd>
        </button>
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+V"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-clipboard-text smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Paste</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ V</kbd>
        </button>
      </div>
    </div>
  </div>
  <div class="smbk-dropdown__anchor">
    <button
      type="button"
      class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-sm smbk-menubar__item"
      role="menuitem"
      tabindex="-1"
      id="menubar-3-opener"
      aria-haspopup="menu"
      aria-expanded="false"
      aria-controls="menubar-3-panel"
    >
      <span class="smbk-btn__label">View</span>
    </button>
    <div class="smbk-dropdown__layer">
      <div
        id="menubar-3-panel"
        role="menu"
        aria-label="View"
        class="smbk-dropdown smbk-dropdown--size-md smbk-dropdown--align-start"
        tabindex="-1"
        data-scrollbar=""
        hidden=""
      >
        <div role="group" aria-labelledby="menubar-3-group-0" class="smbk-dropdown__group">
          <div role="presentation" class="smbk-dropdown__label" id="menubar-3-group-0">Zoom</div>
          <button
            type="button"
            role="menuitemradio"
            aria-checked="false"
            tabindex="-1"
            class="smbk-dropdown__item"
          >
            <span class="smbk-dropdown__text">Fit to window</span>
          </button>
          <button
            type="button"
            role="menuitemradio"
            aria-checked="true"
            tabindex="-1"
            class="smbk-dropdown__item"
          >
            <span class="smbk-dropdown__text">Actual size</span>
            <i
              class="ph ph-check smbk-icon smbk-icon--size-md smbk-dropdown__icon"
              aria-hidden="true"
            ></i>
          </button>
        </div>
        <hr
          class="smbk-divider smbk-divider--orientation-horizontal smbk-dropdown__divider"
          role="separator"
        >
        <button
          type="button"
          role="menuitemcheckbox"
          aria-checked="true"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <span
            class="smbk-checkbox smbk-checkbox--size-sm smbk-checkbox--tone-default smbk-dropdown__checkbox"
            aria-hidden="true"
          >
            <span class="smbk-checkbox__box smbk-checkbox__box--checked">
              <i
                class="ph ph-check smbk-icon smbk-icon--size-md smbk-checkbox__icon"
                aria-hidden="true"
              ></i>
            </span>
          </span>
          <span class="smbk-dropdown__text">Rulers</span>
        </button>
        <button
          type="button"
          role="menuitemcheckbox"
          aria-checked="false"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <span
            class="smbk-checkbox smbk-checkbox--size-sm smbk-checkbox--tone-default smbk-dropdown__checkbox"
            aria-hidden="true"
          >
            <span class="smbk-checkbox__box">
              <i
                class="ph ph-check smbk-icon smbk-icon--size-md smbk-checkbox__icon"
                aria-hidden="true"
              ></i>
            </span>
          </span>
          <span class="smbk-dropdown__text">Grid</span>
        </button>
        <hr
          class="smbk-divider smbk-divider--orientation-horizontal smbk-dropdown__divider"
          role="separator"
        >
        <div class="smbk-dropdown__submenu" role="none">
          <button
            type="button"
            id="menubar-4-item"
            role="menuitem"
            aria-haspopup="menu"
            aria-expanded="false"
            aria-controls="menubar-4-panel"
            tabindex="-1"
            class="smbk-dropdown__item"
          >
            <i
              class="ph ph-sidebar smbk-icon smbk-icon--size-md smbk-dropdown__icon"
              aria-hidden="true"
            ></i>
            <span class="smbk-dropdown__text">Panels</span>
            <i
              class="ph ph-caret-right smbk-icon smbk-icon--size-md smbk-dropdown__icon"
              aria-hidden="true"
            ></i>
          </button>
          <div class="smbk-dropdown__layer">
            <div
              id="menubar-4-panel"
              role="menu"
              aria-labelledby="menubar-4-item"
              class="smbk-dropdown smbk-dropdown--size-md smbk-dropdown--align-start"
              tabindex="-1"
              data-scrollbar=""
              hidden=""
            >
              <button type="button" role="menuitem" tabindex="-1" class="smbk-dropdown__item">
                <i
                  class="ph ph-stack smbk-icon smbk-icon--size-md smbk-dropdown__icon"
                  aria-hidden="true"
                ></i>
                <span class="smbk-dropdown__text">Layers</span>
              </button>
              <button type="button" role="menuitem" tabindex="-1" class="smbk-dropdown__item">
                <i
                  class="ph ph-palette smbk-icon smbk-icon--size-md smbk-dropdown__icon"
                  aria-hidden="true"
                ></i>
                <span class="smbk-dropdown__text">Colors</span>
              </button>
              <button type="button" role="menuitem" tabindex="-1" class="smbk-dropdown__item">
                <i
                  class="ph ph-text-aa smbk-icon smbk-icon--size-md smbk-dropdown__icon"
                  aria-hidden="true"
                ></i>
                <span class="smbk-dropdown__text">Type</span>
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="smbk-dropdown__anchor">
    <button
      type="button"
      class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-sm smbk-menubar__item"
      role="menuitem"
      tabindex="-1"
      id="menubar-5-opener"
      aria-haspopup="menu"
      aria-expanded="false"
      aria-controls="menubar-5-panel"
    >
      <span class="smbk-btn__label">Insert</span>
    </button>
    <div class="smbk-dropdown__layer">
      <div
        id="menubar-5-panel"
        role="menu"
        aria-label="Insert"
        class="smbk-dropdown smbk-dropdown--size-md smbk-dropdown--align-start"
        tabindex="-1"
        data-scrollbar=""
        hidden=""
      >
        <button type="button" role="menuitem" tabindex="-1" class="smbk-dropdown__item">
          <i
            class="ph ph-image smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Picture</span>
        </button>
        <button type="button" role="menuitem" tabindex="-1" class="smbk-dropdown__item">
          <i
            class="ph ph-table smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Table</span>
        </button>
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+K"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-link smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Link</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ K</kbd>
        </button>
      </div>
    </div>
  </div>
  <div class="smbk-dropdown__anchor">
    <button
      type="button"
      class="smbk-btn smbk-btn--tone-ghost smbk-btn--size-sm smbk-menubar__item"
      role="menuitem"
      tabindex="-1"
      id="menubar-6-opener"
      aria-haspopup="menu"
      aria-expanded="false"
      aria-controls="menubar-6-panel"
    >
      <span class="smbk-btn__label">Help</span>
    </button>
    <div class="smbk-dropdown__layer">
      <div
        id="menubar-6-panel"
        role="menu"
        aria-label="Help"
        class="smbk-dropdown smbk-dropdown--size-md smbk-dropdown--align-start"
        tabindex="-1"
        data-scrollbar=""
        hidden=""
      >
        <button type="button" role="menuitem" tabindex="-1" class="smbk-dropdown__item">
          <i
            class="ph ph-book-open smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Guides</span>
        </button>
        <button
          type="button"
          role="menuitem"
          aria-keyshortcuts="Meta+/"
          tabindex="-1"
          class="smbk-dropdown__item"
        >
          <i
            class="ph ph-keyboard smbk-icon smbk-icon--size-md smbk-dropdown__icon"
            aria-hidden="true"
          ></i>
          <span class="smbk-dropdown__text">Keyboard shortcuts</span>
          <kbd class="smbk-kbd smbk-kbd--size-sm" aria-hidden="true">⌘ /</kbd>
        </button>
      </div>
    </div>
  </div>
</div>
```

## React

```tsx
import { Menubar, MenubarMenu } from './design-system/components/menubar/menubar.js';
import { DropdownItem, DropdownDivider, DropdownLabel, DropdownSubmenu } from './design-system/components/dropdown/dropdown.js';

<Menubar label="Editor">
  <MenubarMenu label="File">
    <DropdownItem icon="Plus" kbd="⌘ N">New file</DropdownItem>
    <DropdownItem icon="FolderSimple" kbd="⌘ O">Open</DropdownItem>
    <DropdownItem icon="FloppyDisk" kbd="⌘ S">Save</DropdownItem>
    <DropdownDivider />
    <DropdownItem icon="Trash" kbd="⌘ ⌫" danger>Move to trash</DropdownItem>
  </MenubarMenu>
  <MenubarMenu label="Edit">
    <DropdownItem icon="ArrowCounterClockwise" kbd="⌘ Z">Undo</DropdownItem>
    <DropdownItem icon="ArrowClockwise" kbd="⇧ ⌘ Z">Redo</DropdownItem>
    <DropdownDivider />
    <DropdownItem icon="Scissors" kbd="⌘ X">Cut</DropdownItem>
    <DropdownItem icon="Copy" kbd="⌘ C">Copy</DropdownItem>
    <DropdownItem icon="ClipboardText" kbd="⌘ V">Paste</DropdownItem>
  </MenubarMenu>
  <MenubarMenu label="View">
    <DropdownLabel>Zoom</DropdownLabel>
    <DropdownItem>Fit to window</DropdownItem>
    <DropdownItem selected>Actual size</DropdownItem>
    <DropdownDivider />
    <DropdownItem checked>Rulers</DropdownItem>
    <DropdownItem>Grid</DropdownItem>
    <DropdownDivider />
    <DropdownSubmenu icon="Sidebar" label="Panels">
      <DropdownItem icon="Stack">Layers</DropdownItem>
      <DropdownItem icon="Palette">Colors</DropdownItem>
      <DropdownItem icon="TextAa">Type</DropdownItem>
    </DropdownSubmenu>
  </MenubarMenu>
  <MenubarMenu label="Insert">
    <DropdownItem icon="Image">Picture</DropdownItem>
    <DropdownItem icon="Table">Table</DropdownItem>
    <DropdownItem icon="Link" kbd="⌘ K">Link</DropdownItem>
  </MenubarMenu>
  <MenubarMenu label="Help">
    <DropdownItem icon="BookOpen">Guides</DropdownItem>
    <DropdownItem icon="Keyboard" kbd="⌘ /">Keyboard shortcuts</DropdownItem>
  </MenubarMenu>
</Menubar>
```

## Stylesheet

```css
/* smbk-menubar — Menubar. Figma "Menubar" 8222:3544 (State: Closed, Open).
 * A row of menu titles on the default surface, the rim around it and the large control corner, the extra-small inset
 * all round and no gap between titles. Each title is the ghost button at its small size, 32 tall, with the item part;
 * while its menu shows it keeps the ghost button's pressed fill. The edge is drawn inside, as Figma draws it, so the
 * inset gives its width back: the bar is 40 tall. A row too long for its space wraps onto a second line rather than
 * pushing the page sideways.
 * Each menu is the dropdown: its anchor holds the title and the layer, and the panel hangs the extra-small stack step
 * below the bar, lined up with its title's start, as Figma's Open draws the File menu. With script the wrapper places
 * it there (floating.ts, standing off from the bar); without script it hangs there from its title. */

.smbk-menubar {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--smbk-space-0);
  inline-size: fit-content;
  max-inline-size: 100%;
  padding: calc(var(--smbk-space-inset-xs) - var(--smbk-border-width-hairline));
  border: var(--smbk-border-width-hairline) solid var(--smbk-color-border-rim);
  border-radius: var(--smbk-radius-control-lg);
  background: var(--smbk-color-surface-default);
  color: var(--smbk-color-text-default);
}

/* The title whose menu shows: the ghost button's pressed fill (Figma's Open, Button State=Pressed). */
.smbk-menubar__item[aria-expanded="true"] {
  background: var(--smbk-color-action-ghost-background-pressed);
}

/* Without script, an open menu hangs below the bar, not below its title: the bar's inset and edge, then the gap. */
.smbk-menubar .smbk-dropdown__anchor > .smbk-dropdown__layer:not(:popover-open) > .smbk-dropdown {
  top: calc(100% + var(--smbk-space-inset-xs) + var(--smbk-space-stack-xs));
}
```

## Tokens it reads

```json
{
  "space": {
    "0": {
      "$type": "dimension",
      "$value": "0px",
      "$description": "Raw space step, 0 px. Only for fixed distances inside a component; spacing that follows density uses space/inset, stack or inline."
    },
    "inset": {
      "xs": {
        "$type": "dimension",
        "$value": "{{space.4}}",
        "$description": "Padding inside a component, extra small."
      }
    },
    "stack": {
      "xs": {
        "$type": "dimension",
        "$value": "{{space.4}}",
        "$description": "Gap between things stacked one above another, extra small."
      }
    }
  },
  "border-width": {
    "hairline": {
      "$type": "dimension",
      "$value": "{{border-width.1}}",
      "$description": "Thin lines: dividers and almost every edge."
    }
  },
  "color": {
    "border": {
      "rim": {
        "$type": "color",
        "$value": "{{color.alpha.white.90}}",
        "$description": "The light rim that makes a surface look lit: fields, chosen pills, cards."
      }
    },
    "surface": {
      "default": {
        "$type": "color",
        "$value": "{{color.grey.100}}",
        "$description": "Standard surface: cards, panels, the header."
      }
    },
    "text": {
      "default": {
        "$type": "color",
        "$value": "{{color.grey.900}}",
        "$description": "Main text."
      }
    },
    "action": {
      "ghost": {
        "background-pressed": {
          "$type": "color",
          "$value": "{{color.action.outline.background-pressed}}",
          "$description": "Ghost button: fill while pressed, one step past hover; also the current page in pagination."
        }
      }
    }
  },
  "radius": {
    "control": {
      "lg": {
        "$type": "dimension",
        "$value": "{{radius.8}}",
        "$description": "Corners of controls, large."
      }
    }
  }
}
```

## Purpose

A row of menu titles, as at the top of a desktop app: File, Edit, View, Help. Each title opens a menu of commands, and once one is open the pointer or the arrow keys move straight to the next, so a tool with many commands can keep them all a step away without a button for each. Each menu is the dropdown's menu, with its items, groups, single choices, key hints and second menus. For the links of a site's header, use the header's navigation instead; for a bar of tools that act at once, use the toolbar.

## Anatomy

- The block, the bar: the default surface with its rim and rounded corners, holding the titles side by side.
- The item part, one title: the ghost button at its small size. While its menu shows it keeps the button's pressed fill.
- The menus: one dropdown for each title, its anchor holding the title and the panel, which hangs below the bar lined up with the title's start.

## When to use

- An app or a tool with many commands that people come back to: an editor, a design tool, a dashboard with its own documents.
- Commands that fall into a few familiar groups people expect at the top, such as File, Edit and View.

## When not to use

- A site's navigation between pages. Use the [header](header.md) or the [sidebar](sidebar.md): links are not menu commands.
- A few actions on one thing. Use a [dropdown](dropdown.md) from a button.
- Tools used all the time, which should be one press away. Show them in a [toolbar](toolbar.md).
- A phone. A row of menus needs a pointer and room; give a narrow screen a menu button instead.

## Behavior

Pressing a title opens its menu below the bar, and pressing it again closes it. While a menu shows, moving the pointer onto another title opens that one in its place, so a pointer can sweep along the bar. Choosing an item closes the menu, and so do Escape, a press outside it and focus leaving it. Each menu moves, scrolls and closes as the dropdown does, and an item in it can open a second menu at its side.

The arrow keys move along the bar. In a menu, the left and right arrows close it and open the menu of the title beside it, with focus on its first item, except where they open or close a second menu.

The bar is as wide as its titles and wraps onto a second line in a space too narrow for them. Plain HTML pages get the look from the stylesheets; the keys, the opening and the placing live in the React wrapper.

## Accessibility

### What it does for you

- The bar is a menubar named by its label, and each title a menu item that says it opens a menu and whether it is open, following the menubar pattern of the WAI-ARIA Authoring Practices.
- The bar is one Tab stop: Tab reaches the title last focused, and the arrow keys move between titles.
- Each menu is named by its title and follows the dropdown's menu keys, and Escape closes it with focus back on its title.
- Choosing an item puts focus back on its title, so a keyboard user is never left on a closed menu.

### What you must do

- Give the bar a label that says what its menus act on, such as "Editor".
- Keep each title one or two words, and wire every key hint shown in a menu yourself; the menu only shows and announces it.

### How to test

- Tab to the bar: focus lands on one title. The left and right arrows move between titles and wrap; Home and End go to the first and last.
- On a title, Enter, Space or the down arrow opens its menu on the first item. In the menu, the right arrow opens the next title's menu and the left arrow the previous one, focus on its first item; Escape closes it with focus on its title.
- With a screen reader, the bar is read as a menubar, each title as a menu item that opens a menu, collapsed or expanded.
- With a menu open, move the pointer along the bar: each title's menu opens in turn.

### Keyboard

| Key | What it does |
|---|---|
| Right Arrow or Left Arrow | On a title, moves to the next or previous title, wrapping around; with a menu showing, that title's menu shows instead. In a menu, closes it and opens the next or previous title's menu on its first item. |
| Home or End | On a title, moves to the first or last title. |
| Enter, Space or Down Arrow | On a title, opens its menu with focus on the first item. |
| Up Arrow | On a title, opens its menu with focus on the last item. |
| Escape | In a menu, closes it and returns focus to its title. |
| Tab | Leaves the bar; in a menu, closes it and moves on. |

## Usage rules

### Do

- Order the menus as people expect them: File, Edit, View, then what is the tool's own, Help last.
- Give each command its key hint where it has a shortcut.
- Keep the same commands in the same menus across every screen of the tool.

### Don't

- Put links to other pages in a menubar.
- Leave a title with an empty menu, or a menu with one item.
- Hide the only way to a common command in a menubar: show it in the toolbar or the page too.
