A persistent row of menus
The menus along the top of a desktop app: File, Edit, View. Each menu is a Dropdown menu, so its items, groups, sub-menus, checkboxes and shortcuts work exactly as they do there. The bar is one tab stop, the arrow keys move along it, and once a menu is open, moving along the bar opens the next one.
Default
Compact
For a dense toolbar row or an editor's chrome.
Alternatives
- Use Toolbar instead when the bar holds controls that act at once rather than menus.
- Use Dropdown menu instead when one menu opens from one trigger.
Props
Read from the same JSDoc that ships in the package's types. A required prop is marked with an asterisk.
| Prop | Type | Default | Description |
|---|---|---|---|
menus* | MenubarMenu[] | The menus, in order along the bar. | |
label | string | 'Menu bar' | Accessible name for the bar. |
size | "default" | "compact" | 'default' | Trigger and menu size. |
keyLabels | Partial<Record<string, string>> | Key names for the shortcut hints in every menu, for a keyboard other than English (passed to each DropdownMenu). | |
className | string | '' | Additional CSS classes |
Tested keys
An automated test presses every row below, in a left-to-right and a right-to-left layout.
Menu bar follows the WAI-ARIA menu bar pattern.
| Key | What it does |
|---|---|
Tab | Moves focus into the bar at the last menu it was on, and out of the bar on the next press. |
Arrow Right | Moves to the next menu, opening it if a menu is open. The opposite arrow in a right-to-left layout. |
Arrow Left | Moves to the previous menu, opening it if a menu is open. The opposite arrow in a right-to-left layout. |
End | Moves to the last menu. |
Home | Moves to the first menu. |
Arrow Down | Opens the menu and moves into it; the menu's own keys then apply. |
Escape | Closes the open menu and returns focus to its name in the bar. |
// From the npm package
import { Menubar } from 'rift-ds/components/Menubar/Menubar';
// Or as source you own, via the shadcn CLI
npx shadcn@latest add https://rift-ds.com/r/menubar.json9.7 kB gzipped, with everything it imports. Peer dependencies are not counted.
For agents: the props, their allowed values and defaults, and the tested keys, as markdown or as a JSON schema.