Menubar
An application row of menus, for app screens with three or more command groups.
import { Menubar, MenubarMenu } from '@fairgarden/design/overlays/menubar'
import { MenuItem } from '@fairgarden/design/overlays/menu'
The bar is 44 px tall with a --border-size-1 rule under it. Each MenubarMenu has a type-button-sm trigger whose label is authored in title case with no tracking ("File", "View Options"); the open trigger takes a --border-size-2-25 bar. Its items are the Menu's parts, in the Menu's portaled white popup, which never changes with the bar's ground. Below 1024 px the bar collapses into one "Menu" trigger, and each menu becomes a labelled group in its popup. The bar is hidden in print.
Use a menubar only on application screens; menus for one object belong in a Menu, and page navigation belongs in the navigation components.
An application menubar
An application menubar
Narrow the window below 1024 px to see the collapsed "Menu".
No command yet. Grid on, contours off.
Outline morph
On by default: pressing a trigger grows its ring (or, by pointer, its box) into the menu's frame, and Escape, a choice or an outside press shrinks it back. Moving between menus while one is open, by pointer or arrow keys, stays instant. morph={false} on the Menubar, or on one MenubarMenu, opens and closes them at once; see Outline Morph.
API Reference
Menubar
The bar (Base UI Menubar): --fgd-size-hit tall with a --border-size-1
--role-rule under it, holding MenubarMenus. Below --lg-n-above it
collapses into one collapsedLabel trigger whose popup lists each menu
as a labelled group.
| Prop | Type | Description |
|---|---|---|
collapsedLabel | | The single trigger’s label below --lg-n-above, where the menus collapse into one menu of labelled groups. Title case. Default “Menu”. |
collapsedPopupProps | | Props for the collapsed menu’s popup. |
morph | | The outline morph for every menu of the bar: a press grows the
trigger’s ring (or box) into the popup’s frame, and Escape, a choice
or an outside press shrinks it back; moving between menus stays
instant. Default |
primary | | Primary Radix scale for the bar: triggers, rule, open bar and ring. Never defaulted [D133]. |
secondary | | Secondary Radix scale for the bar. Never defaulted. |
MenubarMenu
One menu of the bar: a type-button-sm trigger and a Menu popup of its
items. Inside the collapsed “Menu” it renders as a MenuGroup under a
MenuGroupLabel of the same label.
| Prop | Type | Description |
|---|---|---|
label | | The trigger’s label, authored in title case with no tracking (“File”, “Edit”, “View Options”) [D160, D165]; the group label when collapsed. |
morph | | The outline morph for this menu. Default: the Menubar’s |
popupProps | | Props for the menu’s popup (placement, color axes). |
disabled | | Disables the trigger. |
children | | The menu’s items: MenuItem, MenuCheckboxItem, MenuRadioGroup, MenuSubmenu … |
Additional types
menubar
MenubarMenuProps
MenubarProps
Specification: DESIGN-SYSTEM.md §9.7 (menu and menubar) and D165 (title-case command triggers).