Skip to content
UI

Search docs

Search components and documentation

New
Menu

Menubar

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

Installation

npx logic2b@latest add 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

Prop Type Default
variant (MenubarItem) default | destructive default
inset (MenubarItem / Label / SubTrigger) boolean false
checked (MenubarCheckboxItem) boolean
value (MenubarRadioGroup / MenubarRadioItem) string

Examples

Checkboxes and radios

Accessibility

Built on Radix Menubar, which follows the WAI-ARIA menubar pattern.

  • Arrow keys move focus between menus and items; Enter or Space activates the focused item.
  • Esc closes the open menu and returns focus to its trigger.
  • Typeahead lets you jump to an item by typing its label.
  • Checkbox and radio items expose the correct role and checked state to assistive technology.