Menubar

17 parts

A horizontal bar of menus, like the File / Edit / View row in a desktop app. Each MenubarMenu owns a trigger and its dropdown; the root coordinates them so only one is open at a time, arrow keys move between triggers, and typeahead jumps to a trigger by name. Built on top of Menu, so every menu inherits keyboard navigation, nested submenus, and checkbox/radio items. Use it for application-style menu bars in editors, dashboards, and tools. The root holds which menu is open; bind v-model (or listen to update:modelValue) to control or observe the active menu's value.

Demo

Loading demo…

Anatomy

Import the parts and compose them. Each part forwards attributes to its underlying element.

vue
import {
  MenubarRoot,
  MenubarMenu,
  MenubarTrigger,
  MenubarContent,
  MenubarPortal,
  MenubarArrow,
  MenubarSeparator,
  MenubarLabel,
  MenubarGroup,
  MenubarItem,
  MenubarCheckboxItem,
  MenubarRadioGroup,
  MenubarRadioItem,
  MenubarItemIndicator,
  MenubarSub,
  MenubarSubTrigger,
  MenubarSubContent,
} from '@robonen/primitives/menus/menubar';

<MenubarRoot>
  <MenubarMenu />
  <MenubarTrigger />
  <MenubarContent />
  <MenubarPortal />
  <MenubarArrow />
  <MenubarSeparator />
  <MenubarLabel />
  <MenubarGroup />
  <MenubarItem />
  <MenubarCheckboxItem />
  <MenubarRadioGroup />
  <MenubarRadioItem />
  <MenubarItemIndicator />
  <MenubarSub />
  <MenubarSubTrigger />
  <MenubarSubContent />
</MenubarRoot>

API Reference