Menubar
An app-style menu bar (File, Edit, View…).
Overview
- Structure:
Menubaris a react-ariaToolbar, so arrow keys move between menus. EachMenubarMenupairs aMenubarTriggerwith aMenubarContentbuilt onDropdownMenu, including submenus (MenubarSub). - Checkable items: come from react-aria selection — give a
MenubarGroupaselectionMode("multiple"or"single") andselectedKeys/onSelectionChange, and its items show a check when selected. - Opening: menus open on press or Enter/Space/ArrowDown. While one is open, hovering another trigger or pressing ArrowLeft/ArrowRight opens the neighbouring menu.
Installation
CLI
Manual
- 1
Register the @fma-ds namespace in components.json (once)
- 2
Add the item
Files land in
components/fma-ds/menubar.tsx; npm and registry dependencies are installed along with them.
Dependencies
- npm
- cn@^0.5.0react-aria-components@^1.22.1
- Registry
- @fma-ds/dropdown-menu