For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
Home

Menubar

A persistent horizontal menu bar with dropdown menus — checkboxes, radio groups, sub-menus, and keyboard shortcuts.

import { useState } from "react";
import { Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger } from "@/components/ui/menubar";

export const MenubarDemo = () => {
  const [showStatusBar, setShowStatusBar] = useState(true);
  const [showActivityBar, setShowActivityBar] = useState(false);
  const [theme, setTheme] = useState("system");

  return (
    <Menubar>
      <MenubarMenu>
        <MenubarTrigger>File</MenubarTrigger>
        <MenubarContent>
          <MenubarItem>New Tab <MenubarShortcut>⌘T</MenubarShortcut></MenubarItem>
          <MenubarItem>New Window <MenubarShortcut>⌘N</MenubarShortcut></MenubarItem>
          <MenubarItem disabled>New Incognito Window</MenubarItem>
          <MenubarSeparator />
          <MenubarSub>
            <MenubarSubTrigger>Share</MenubarSubTrigger>
            <MenubarSubContent>
              <MenubarItem>Email Link</MenubarItem>
              <MenubarItem>Messages</MenubarItem>
              <MenubarItem>AirDrop</MenubarItem>
            </MenubarSubContent>
          </MenubarSub>
          <MenubarSeparator />
          <MenubarItem>Print <MenubarShortcut>⌘P</MenubarShortcut></MenubarItem>
        </MenubarContent>
      </MenubarMenu>
      <MenubarMenu>
        <MenubarTrigger>Edit</MenubarTrigger>
        <MenubarContent>
          <MenubarItem>Undo <MenubarShortcut>⌘Z</MenubarShortcut></MenubarItem>
          <MenubarItem>Redo <MenubarShortcut>⇧⌘Z</MenubarShortcut></MenubarItem>
          <MenubarSeparator />
          <MenubarItem>Cut <MenubarShortcut>⌘X</MenubarShortcut></MenubarItem>
          <MenubarItem>Copy <MenubarShortcut>⌘C</MenubarShortcut></MenubarItem>
          <MenubarItem>Paste <MenubarShortcut>⌘V</MenubarShortcut></MenubarItem>
          <MenubarSeparator />
          <MenubarItem>Find <MenubarShortcut>⌘F</MenubarShortcut></MenubarItem>
        </MenubarContent>
      </MenubarMenu>
      <MenubarMenu>
        <MenubarTrigger>View</MenubarTrigger>
        <MenubarContent>
          <MenubarCheckboxItem checked={showStatusBar} onCheckedChange={setShowStatusBar}>Status Bar</MenubarCheckboxItem>
          <MenubarCheckboxItem checked={showActivityBar} onCheckedChange={setShowActivityBar}>Activity Bar</MenubarCheckboxItem>
          <MenubarSeparator />
          <MenubarLabel>Theme</MenubarLabel>
          <MenubarRadioGroup value={theme} onValueChange={setTheme}>
            <MenubarRadioItem value="light">Light</MenubarRadioItem>
            <MenubarRadioItem value="dark">Dark</MenubarRadioItem>
            <MenubarRadioItem value="system">System</MenubarRadioItem>
          </MenubarRadioGroup>
          <MenubarSeparator />
          <MenubarItem variant="destructive">Reset Layout</MenubarItem>
        </MenubarContent>
      </MenubarMenu>
    </Menubar>
  );
};

Keyboard shortcut

Use MenubarShortcut at the end of a MenubarItem to show the associated key combination right-aligned.

<MenubarItem>
  New Tab <MenubarShortcut>⌘T</MenubarShortcut>
</MenubarItem>

Checkbox item

Toggle state with MenubarCheckboxItem. Manage the value with controlled checked + onCheckedChange.

const [show, setShow] = useState(true);
 
<MenubarCheckboxItem checked={show} onCheckedChange={setShow}>
  Status Bar
</MenubarCheckboxItem>

Radio group

Use MenubarRadioGroup + MenubarRadioItem for mutually exclusive options. Pair with MenubarLabel for the group heading.

<MenubarLabel>Theme</MenubarLabel>
<MenubarRadioGroup value={theme} onValueChange={setTheme}>
  <MenubarRadioItem value="light">Light</MenubarRadioItem>
  <MenubarRadioItem value="dark">Dark</MenubarRadioItem>
  <MenubarRadioItem value="system">System</MenubarRadioItem>
</MenubarRadioGroup>

Nest a MenubarSub inside any MenubarContent. MenubarSubTrigger auto-appends a chevron.

<MenubarSub>
  <MenubarSubTrigger>Share</MenubarSubTrigger>
  <MenubarSubContent>
    <MenubarItem>Email Link</MenubarItem>
    <MenubarItem>Messages</MenubarItem>
  </MenubarSubContent>
</MenubarSub>

Destructive item

<MenubarItem variant="destructive">Reset Layout</MenubarItem>

Disabled item

<MenubarItem disabled>New Incognito Window</MenubarItem>

Props

The root container. Renders as a flex row with border and shadow. Extends all Radix Menubar.Root props. Groups a trigger and its content. Accepts a value prop for controlled open state. The clickable label in the bar. Highlights on hover/focus and when its menu is open (data-[state=open]).
PropTypeDefaultDescription
align"start" | "center" | "end""start"Alignment relative to trigger
alignOffsetnumber-4Horizontal offset from trigger edge
sideOffsetnumber8Gap between bar and content
PropTypeDefaultDescription
variant"default" | "destructive""default"Destructive variant applies red text
insetbooleanfalseAdds pl-8 to align with checked/radio items
disabledbooleanfalseDisables interaction and reduces opacity

Usage

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

Specs

# Mint — Menubar Specs
 
## Component
- name: menubar
- file: registry/mint/menubar.tsx
- installs to: components/ui/menubar.tsx
- dependencies: radix-ui, lucide-react
- registryDependencies: none
 
## What is it
A persistent horizontal bar where each trigger opens a dropdown panel of
actions, checkboxes, radio groups, and sub-menus. Built on Radix Menubar for
full keyboard navigation. Use it for app-level toolbars (File, Edit, View);
do not use it for primary site navigation — prefer a nav element instead.
 
## Visual identity
Compact and confident in Mint: the bar sits on --background with a
single-pixel border and a subtle shadow-xs. Triggers and items highlight with
a soft green --accent on hover/focus, giving the palette a fresh,
content-forward feel. A generous 1.25rem radius on the bar, panels, and item
rows gives a light, airy, rounded feel.
 
## Design tokens
--background: oklch(1 0 0) / oklch(0.145 0 0)               — menubar root surface
--border: oklch(0.88 0.04 155 / 60%) / oklch(0.32 0.05 155 / 40%)              — bar border and separator
--accent: oklch(0.92 0.05 155) / oklch(0.26 0.05 155)                 — trigger/item hover+focus background
--accent-foreground: oklch(0.32 0.1 155) / oklch(0.88 0.06 155)     — trigger/item hover+focus text
--popover: oklch(1 0 0) / oklch(0.269 0 0)                   — content panel surface
--popover-foreground: oklch(0.145 0 0) / oklch(0.985 0 0)    — content panel text
--muted-foreground: oklch(0.52 0.06 155) / oklch(0.6 0.06 155)      — shortcut text and icon default colour
--destructive: oklch(0.55 0.25 15) / oklch(0.704 0.191 22.216) — destructive item text
 
## Sub-components
- Menubar              → Root bar; h-9 flex row rounded-md border px-1 gap-1 shadow-xs bg-background
- MenubarMenu          → Groups one trigger with its content; no visual output
- MenubarTrigger       → Bar button; px-3 py-1 text-sm font-medium rounded-sm; focus/open → bg-accent
- MenubarPortal        → Renders content outside DOM hierarchy; no visual output
- MenubarContent       → Dropdown panel; min-w-48 rounded-md border p-1 shadow-md bg-popover; defaults align=start, alignOffset=-4, sideOffset=8
- MenubarGroup         → Logical grouping of items; no visual output
- MenubarItem          → Action row; px-2 py-1.5 text-sm rounded-sm gap-2; variants: default | destructive; inset prop adds pl-8
- MenubarCheckboxItem  → Toggle item; pl-8 with absolute CheckIcon indicator
- MenubarRadioGroup    → Wraps mutually exclusive radio items; no visual output
- MenubarRadioItem     → Radio choice; pl-8 with absolute CircleIcon (size-2 fill-current) indicator
- MenubarLabel         → Section heading; px-2 py-1.5 text-sm font-medium; inset prop adds pl-8
- MenubarSeparator     → Horizontal rule; -mx-1 my-1 h-px bg-border
- MenubarShortcut      → Key hint span; ml-auto text-xs tracking-widest text-muted-foreground
- MenubarSub           → Sub-menu root; no visual output
- MenubarSubTrigger    → Item that opens a sub-menu; appends ChevronRightIcon ml-auto automatically; inset prop adds pl-8
- MenubarSubContent    → Sub-menu panel; min-w-32 rounded-md border p-1 shadow-lg bg-popover
 
## States
- focus / data-[state=open]: trigger and sub-trigger gain bg-accent + text-accent-foreground
- focus (items): MenubarItem, CheckboxItem, RadioItem, SubTrigger gain bg-accent + text-accent-foreground on focus
- data-[variant=destructive]: item text becomes --destructive; focus background is destructive/10 (light) or destructive/20 (dark)
- data-disabled: pointer-events-none + opacity-50 on items, checkbox items, and radio items
- open/close animation: content and sub-content use fade + zoom entrance/exit keyed on data-[state]
 
## Conventions
- Place MenubarShortcut at the end of a MenubarItem — it auto-aligns right via ml-auto
- Use inset={true} on MenubarItem or MenubarLabel to align text with CheckboxItem/RadioItem indicators (adds pl-8)
- Wrap mutually exclusive options in MenubarRadioGroup + MenubarRadioItem; add a MenubarLabel above the group for context
- Keyboard navigation is built-in: ArrowLeft/Right moves between top-level triggers; ArrowDown opens the focused trigger's menu; ArrowUp/Down moves between items; ArrowRight opens a sub-menu; Escape closes
- Sub-components expose data-slot attributes for CSS targeting: "menubar", "menubar-menu", "menubar-trigger", "menubar-portal", "menubar-content", "menubar-group", "menubar-item", "menubar-checkbox-item", "menubar-radio-group", "menubar-radio-item", "menubar-label", "menubar-separator", "menubar-shortcut", "menubar-sub", "menubar-sub-trigger", "menubar-sub-content"
- SVG icons inside items default to size-4 and text-muted-foreground unless overridden with a text-* class

Installation

GIN Design Plugin
$ npx shadcn add https://gin-design.vercel.app/menubar