ui-kit0.0

Navigation

Menubar

Desktop-style menus in a bar.

Usage

A bar of menus, like the File / Edit / View bar of a desktop app. Compose Menubar, one MenubarMenu per title, each with a MenubarTrigger and MenubarContent. Items, checkbox and radio items and submenus are the dropdown menu's own parts under a Menubar name.

Nothing chosen yet · sidebar on · default

When to use

  • Apps with many commands grouped by area (editors, design tools, admin consoles on desktop).
  • Once one menu is open, moving to another title switches to it without another click.

Not for: site navigation (use the navbar or navigation menu) or a single list of actions (use the dropdown menu).

API

Menubar

PropTypeDefaultDescription
valuestring | null—Controlled: the value of the open menu.
defaultValuestring | nullnullInitial open menu when uncontrolled.
onValueChange(value: string | null) => void—Called when the open menu changes.

MenubarMenu

PropTypeDefaultDescription
valuestring—Identifies the menu in the bar value. Generated when omitted.

MenubarContent takes placement (default bottom-start) and offset (default 6). Also: MenubarItem, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarLabel, MenubarSeparator, MenubarGroup, MenubarSub, MenubarSubTrigger and MenubarSubContent with the same props as their DropdownMenu counterparts.

Keyboard

KeyAction
← / →On a title: moves to the previous / next title. With a menu open: switches to that menu.
↓ / Enter / SpaceOn a title: opens the menu with the first item focused.
↑On a title: opens the menu with the last item focused.
Home / EndOn a title: first / last title.
↓ / ↑ / Home / End / A–ZIn a menu: move between items.
→ / ←In a menu: opens / closes a submenu; on a plain item moves to the next / previous menu.
EscCloses the menu and returns focus to its title.

Accessibility

  • Follows the WAI-ARIA menubar pattern: role="menubar" with menuitem titles that have aria-haspopup, aria-expanded and aria-controls.
  • The bar is one tab stop (roving tabindex); arrows move within it.
  • Each menu is labelled by its title.

Motion

  • Titles tint in 150ms; menus pop open from their title (150ms) and fade out in 160ms.
  • Switching menus closes one and opens the next at once, with no gap.
  • Reduced motion: menus appear without movement.