Appica UIUI 1.0.0

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's size.
  • 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. Fires onClick and 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.

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 DropdownMenuMenubarCheckboxItem 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.

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.

The bar. Coordinates the menus and holds the shared styling/orientation; renders a menubar element.

Wraps one menu in the bar. Inherits the bar's size; forwards the rest to the underlying menu root.

The top-level label that opens its menu. Inherits the bar's variant, size, and orientation.

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.

One action in a menu.

A toggleable item with a check indicator. Keeps the menu open on click.

Wraps a set of mutually exclusive MenubarRadioItems.

One option in a MenubarRadioGroup. Keeps the menu open on click.

An item that renders an <a> for navigation. Forwards every native anchor prop (href, target, rel, …).

Wraps one labelled section of a menu so a MenubarGroupLabel can name it.

The visible heading for a MenubarGroup. Size-aware; must be rendered inside a MenubarGroup (or MenubarRadioGroup).

A thin divider between items or groups.

Wraps a nested submenu inside a menu.

The item that opens a submenu; renders a trailing chevron. Submenus open on hover by default.

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 with aria-label. Triggers are menuitems with aria-haspopup, and each popup is a menu.
  • ←/→ (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.
  • disabled triggers and items are skipped by keyboard navigation.
  • Popup enter/exit transitions are skipped when the user prefers reduced motion.

© 2026 Appica UI. A free component library, crafted by the Appica team.