Menubar
A bar of menus for an app's top-level commands.
Usage
Menubar is a compound component built on Base UI's Menubar. The root is the bar that coordinates a row (or column) of menus, sharing variant, size, and orientation with all of them:
MenubarMenu— wraps one menu (a menu root under the hood). It inherits the bar'ssize.MenubarTrigger— the top-level label that opens its menu. Once any menu is open, moving the pointer to a sibling trigger switches to it; arrow keys move focus along the bar.MenubarContent— the portalled popup for that menu. In a vertical bar it opens to the side automatically.MenubarItem— one action. FiresonClickand closes the menu by default.MenubarGroup/MenubarGroupLabel/MenubarSeparator— structure for sectioned menus.MenubarCheckboxItem/MenubarRadioGroup+MenubarRadioItem— stateful options with a check indicator.MenubarLinkItem— an item that renders an<a>for navigation.MenubarSub/MenubarSubTrigger/MenubarSubContent— a nested submenu.
Inside an item, put a leading icon on data-icon="start", and push a trailing Kbd shortcut to the edge with ms-auto.
Reach for a Menubar for the persistent command bar of an application (File / Edit / View …). For a single menu opened from one button, use a DropdownMenu; for in-page navigation with rich panels, use a Navigation Menu.
Examples
Application menu
A typical desktop-style command bar — File, Edit, and View menus with keyboard shortcuts, separators, a nested "Open recent" submenu, and a disabled item.
Variants
variant styles the triggers: pill (default) gives each a hover/active pill, while line draws an animated underline — closer to a classic desktop menu bar.
Vertical
Set orientation="vertical" to stack the menus into a sidebar. Triggers can carry a leading icon (data-icon="start"), and each menu opens to the inline-end side. Menus normally only flip to the opposite same-axis side; pass collisionAvoidance={{ fallbackAxisSide: 'end' }} so a side-opening menu can also fall back to the top/bottom axis when it doesn't fit there.
Submenus
Nest a MenubarSub inside a menu with its own MenubarSubTrigger and MenubarSubContent. The sub-trigger shows a chevron and opens to the side on hover or with the arrow keys, flipping automatically near a screen edge.
Checkbox & radio items
Menus support the same stateful items as DropdownMenu — MenubarCheckboxItem for toggles and a MenubarRadioGroup of MenubarRadioItems for a single choice, both grouped under a MenubarGroupLabel.
Leading icons
Put a leading icon on the data-icon="start" slot, before the label — it works on both a MenubarTrigger and a MenubarItem, which reserves space and aligns every row's text. Pair an item with a trailing Kbd shortcut pushed to the edge with ms-auto.
RTL
Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus along the bar, popup placement, and submenu direction — follows the same direction.
The bar lays out from the right, arrow-key focus reverses, and popups anchor and flip accordingly. For setup details and caveats, see the RTL guide.
Scoped RTL needs the direction on the positioner
Each menu's popup portals to <body>, so its start/end alignment mirrors from the document direction (read from
CSS, not from DirectionProvider) — automatic when <html dir="rtl">. If you instead scope RTL to a subtree of an LTR
page, set it on the positioner so alignment still mirrors: <MenubarContent positionerProps={{ dir: 'rtl' }}>. See
Floating popups in a scoped RTL region.
API reference
Menubar wraps Base UI's Menubar and composes a menu for each entry. Each part forwards every remaining prop to the matching Base UI primitive, so anything it accepts works here — the tables below list the Appica additions and the most common props. See the Base UI docs for the complete API.
Menubar
The bar. Coordinates the menus and holds the shared styling/orientation; renders a menubar element.
MenubarMenu
Wraps one menu in the bar. Inherits the bar's size; forwards the rest to the underlying menu root.
MenubarTrigger
The top-level label that opens its menu. Inherits the bar's variant, size, and orientation.
MenubarContent
The portalled popup for a menu. In a vertical bar it defaults to side="inline-end" / align="start"; in a horizontal bar it opens below the trigger. Accepts the shared floating props.
MenubarItem
One action in a menu.
MenubarCheckboxItem
A toggleable item with a check indicator. Keeps the menu open on click.
MenubarRadioGroup
Wraps a set of mutually exclusive MenubarRadioItems.
MenubarRadioItem
One option in a MenubarRadioGroup. Keeps the menu open on click.
MenubarLinkItem
An item that renders an <a> for navigation. Forwards every native anchor prop (href, target, rel, …).
MenubarGroup
Wraps one labelled section of a menu so a MenubarGroupLabel can name it.
MenubarGroupLabel
The visible heading for a MenubarGroup. Size-aware; must be rendered inside a MenubarGroup (or MenubarRadioGroup).
MenubarSeparator
A thin divider between items or groups.
MenubarSub
Wraps a nested submenu inside a menu.
MenubarSubTrigger
The item that opens a submenu; renders a trailing chevron. Submenus open on hover by default.
MenubarSubContent
The submenu popup. Defaults to opening on the inline-end side; otherwise identical to MenubarContent.
Accessibility
- The bar has
role="menubar"; give it an accessible name witharia-label. Triggers aremenuitems witharia-haspopup, and each popup is amenu. - ←/→ (or ↑/↓ when vertical) move focus between triggers; Enter / Space / ↓ open a menu; Escape closes it back to its trigger; typeahead jumps to matching items.
- With a menu open, hovering a sibling trigger switches to its menu without an extra click.
disabledtriggers and items are skipped by keyboard navigation.- Popup enter/exit transitions are skipped when the user prefers reduced motion.