Menubar
An app-style menu bar (File, Edit, View…). Menubar is a react-aria Toolbar, so arrow keys move between menus; each MenubarMenu pairs a MenubarTrigger with a MenubarContent built on DropdownMenu, including submenus (MenubarSub). Checkbox- and radio-like items come from react-aria selection: give a MenubarGroup selectionMode ("multiple" or "single") and selectedKeys/onSelectionChange, and its items show a check when selected. 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-ui namespace in components.json (once)
components.json{ "registries": { "@fma-ui": "https://ui.fmartinsandre.dev.br/r/{name}.json" } } - 2
Add the item
pnpm dlx shadcn@latest add @fma-ui/menubarFiles land in
components/fma-ui/menubar.tsx; npm and registry dependencies are installed along with them.
Dependencies
- npm
- cn@^0.4.0react-aria-components@^1.21.1
- Registry
- @fma-ui/dropdown-menu