Skip to content

Menubar

A horizontal bar of menus, like a desktop application menu.

API Reference

Installation

pnpm dlx shadcn@latest add @frontal-labs/menubar

Usage

import {
  Menubar,
  MenubarContent,
  MenubarItem,
  MenubarMenu,
  MenubarTrigger,
} from "@/components/ui/menubar";
<Menubar>
  <MenubarMenu>
    <MenubarTrigger>File</MenubarTrigger>
    <MenubarContent>
      <MenubarItem>New tab</MenubarItem>
      <MenubarItem>New window</MenubarItem>
    </MenubarContent>
  </MenubarMenu>
</Menubar>

API Reference

Root bar. Once one menu is open, moving the pointer across the bar opens its neighbours.

Wraps one trigger and its content.

The top-level button for a menu.

The popup surface for a menu, elevated with shadow-menu and surface-ring. It forwards to DropdownMenuContent, so it takes the same positioning props (align defaults to "start", alignOffset to -4, sideOffset to 8).

It also accepts dark (boolean, defaults to true), which renders the surface with the dark palette. Pass dark={false} when it should follow the ambient theme instead: next-themes sets dark on <html> and the portal lands in document.body, inside it, so the menu can pick up the ambient theme once dark is turned off. For a menu opened from a .dark region scoped mid-page, which a portal does escape, rendering into the scoped node is usually the better tool.

A selectable action.

An item with a checked state.

Groups MenubarRadioItem elements so only one can be selected.

A single choice inside a MenubarRadioGroup.

Groups related items.

A non-interactive heading for a group.

A dividing line between groups.

Right-aligned keyboard hint inside an item.

Wraps a nested submenu.

Opens the submenu.

The submenu popup, elevated with the same shadow-menu + surface-ring treatment.

Renders the popup into a portal.

Examples

Checkbox, Radio and Submenu Items