Make your AI a shadcn expert

Shadcn Menubar

React menubar for desktop-style File, Edit, and View bars. Built with TypeScript and Tailwind CSS for Next.js using Base UI — nested menus and keyboard shortcuts.

A menubar is a persistent row of menus — File, Edit, View. Click a trigger and the panel opens; once one is open, moving to the next trigger opens that menu. Use it for desktop-style apps, not website navigation.

Scroll to load preview...

Looking for a neobrutalism version for shadcn?

Same menubar, thicker borders. The NeoBrutalism menubar is the kit if you want that look.

Usage

import {
  Menubar,
  MenubarContent,
  MenubarGroup,
  MenubarItem,
  MenubarMenu,
  MenubarSeparator,
  MenubarShortcut,
  MenubarTrigger,
} from "@/components/ui/menubar"
<Menubar>
  <MenubarMenu>
    <MenubarTrigger>File</MenubarTrigger>
    <MenubarContent>
      <MenubarGroup>
        <MenubarItem>
          New Tab <MenubarShortcut>⌘T</MenubarShortcut>
        </MenubarItem>
        <MenubarItem>New Window</MenubarItem>
      </MenubarGroup>
      <MenubarSeparator />
      <MenubarGroup>
        <MenubarItem>Share</MenubarItem>
        <MenubarItem>Print</MenubarItem>
      </MenubarGroup>
    </MenubarContent>
  </MenubarMenu>
</Menubar>

Each MenubarMenu is one trigger plus its panel. value on the root is which menu is open, not which item.

Composition

MenubarTrigger
MenubarLabel
MenubarItem
MenubarItem
MenubarSeparator
MenubarSeparator

Checkbox

MenubarCheckboxItem for options that toggle independently. checked is the state.

Scroll to load preview...

Radio

MenubarRadioGroup plus MenubarRadioItem when only one value can be on.

Scroll to load preview...

MenubarSub, MenubarSubTrigger, and MenubarSubContent nest a second panel. Keep it one level.

Scroll to load preview...

With Icons

Icons sit in the item before the label. variant="destructive" is the red row.

Scroll to load preview...

RTL

Wrap with DirectionProvider and dir="rtl". Submenus open toward the start.

Scroll to load preview...

API

Prop

Type

Prop

Type

Prop

Type

MenubarCheckboxItem takes checked and onCheckedChange. MenubarRadioGroup takes value and onValueChange. MenubarLabel and MenubarSubTrigger take inset.

Keyboard

KeyAction
Space / EnterOpen the focused trigger, or activate the focused item
ArrowDownOpen the menu, or move to the next item
ArrowUpMove to the previous item
ArrowRight / ArrowLeftNext / previous trigger. Opens or closes a submenu
EscapeClose the menu and return to its trigger
TabLeave the menubar

Once a menu is open, arrowing to the next trigger opens that menu.

Notes

Shortcuts are labels

MenubarShortcut does not bind a key. Show ⌘S in the row, then listen for the combination yourself.

Don’t use this as site navigation — that is a Navigation Menu.

With other components

Questions

Was this page helpful?

Sign in to leave feedback.