fma-ds

Menubar

An app-style menu bar (File, Edit, View…).

NavigationoriginalMITChangelogRegistry JSON

Overview

  • Structure: 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).
  • Checkable items: come from react-aria selection — give a MenubarGroup a selectionMode ("multiple" or "single") and selectedKeys/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

  1. 1

    Register the @fma-ds namespace in components.json (once)

    components.json
    {  "registries": {    "@fma-ds": "https://ds.fmartinsandre.dev.br/r/{name}.json"  }}
  2. 2

    Add the item

    pnpm dlx shadcn@latest add @fma-ds/menubar

    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