Uqudo UIregistry

Menubar

A persistent menu bar with dropdown menus, as seen in desktop applications.

Installation

npx shadcn@latest add @uqudo/menubar

Usage

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

Each MenubarMenu pairs one MenubarTrigger with one MenubarContent. Content is rendered through a portal, so it can escape overflow containers.

API Reference

Prop

Type

Prop

Type

Other exports

MenubarCheckboxItem, MenubarRadioItem, MenubarSubTrigger and MenubarLabel also accept the inset boolean. Everything else forwards className and the props of the matching Radix primitive.

ComponentWrapsNotes
MenubarMenubar.RootThe bar itself.
MenubarMenuMenubar.MenuOne trigger + content pair.
MenubarTriggerMenubar.TriggerThe button in the bar.
MenubarGroupMenubar.GroupGroups related items.
MenubarLabelMenubar.LabelNon-interactive heading inside a menu.
MenubarSeparatorMenubar.SeparatorThin divider.
MenubarShortcutspanRight-aligned hint text, e.g. ⌘T.
MenubarCheckboxItemMenubar.CheckboxItemShows a check mark when checked.
MenubarRadioGroupMenubar.RadioGroupControls a set of MenubarRadioItems via value.
MenubarRadioItemMenubar.RadioItemShows a check mark when selected.
MenubarSubMenubar.SubNested menu container.
MenubarSubTriggerMenubar.SubTriggerOpens the sub menu; renders a chevron.
MenubarSubContentMenubar.SubContentThe nested menu panel.
MenubarPortalMenubar.PortalAlready used by MenubarContent.

Data attributes

Every element carries a data-slot such as menubar, menubar-trigger, menubar-content or menubar-item. Items also expose data-inset and data-variant.

On this page