--- title: Menubar description: A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands. base: radix component: true links: doc: https://www.radix-ui.com/docs/primitives/components/menubar api: https://www.radix-ui.com/docs/primitives/components/menubar#api-reference --- ## Installation Command Manual ```bash npx shadcn@latest add menubar ``` Install the following dependencies: ```bash npm install radix-ui ``` Copy and paste the following code into your project. Update the import paths to match your project setup. ## Usage ```tsx showLineNumbers import { Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarTrigger, } from "@/components/ui/menubar" ``` ```tsx showLineNumbers File New Tab ⌘T New Window Share Print ``` ## Composition Use the following composition to build a `Menubar`: ```text Menubar ├── MenubarMenu │ ├── MenubarTrigger │ └── MenubarContent │ ├── MenubarGroup │ │ ├── MenubarLabel │ │ ├── MenubarItem │ │ └── MenubarItem │ ├── MenubarSeparator │ ├── MenubarGroup │ │ ├── MenubarLabel │ │ ├── MenubarCheckboxItem │ │ └── MenubarCheckboxItem │ ├── MenubarSeparator │ ├── MenubarGroup │ │ ├── MenubarLabel │ │ └── MenubarRadioGroup │ │ ├── MenubarRadioItem │ │ └── MenubarRadioItem │ └── MenubarSub │ ├── MenubarSubTrigger │ └── MenubarSubContent │ └── MenubarGroup │ ├── MenubarLabel │ ├── MenubarItem │ └── MenubarItem └── MenubarMenu ├── MenubarTrigger └── MenubarContent └── MenubarGroup ├── MenubarLabel ├── MenubarItem └── MenubarItem ``` ## Checkbox Use `MenubarCheckboxItem` for toggleable options. ## Radio Use `MenubarRadioGroup` and `MenubarRadioItem` for single-select options. ## Submenu Use `MenubarSub`, `MenubarSubTrigger`, and `MenubarSubContent` for nested menus. ## With Icons ## RTL To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). ## API Reference See the [Radix UI Menubar](https://www.radix-ui.com/docs/primitives/components/menubar#api-reference) documentation.