Skip to content
Twentyfirst UIPro

Menubar

Navigation · Menubar, Menu

View as Markdown

A desktop-style row of menus (File, Edit, View). Each menu is a regular Menu, so items can have icons, shortcuts, checkbox and radio states and submenus.

  • Keyboard: ←/→ move between menus (and switch the open one), ↓/Enter/Space open, ↑/↓ move inside, → and ← open and close submenus, Escape closes and returns to the bar.
  • Moving the pointer across the bar switches menus once one is open.

Props

Menubar

PropTypeNotes
menusMenubarMenu[]Required
label?stringAccessible name of the bar.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.

Menu

PropTypeNotes
items(MenuItem | "-")[]Required
label?stringAccessible name of the menu.
autoFocus?booleanFocus the first item on mount (menus opened from a button or the keyboard).
onClose?() => voidCalled after an item runs, and on Escape, so the owner can close the menu.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.