Menu

A menu displays a list of actions or options that a user can choose.

<Menu>
  <Button>Open Menu</Button>
  <Popover>
    <MenuContent>
      <MenuItem>Edit</MenuItem>
      <MenuItem>Duplicate</MenuItem>
      <MenuItem>Archive</MenuItem>
      <MenuItem>Delete</MenuItem>
    </MenuContent>
  </Popover>
</Menu>

Installation

npx shadcn@latest add @dotui/menu

Usage

Use menus to display a list of actions or options that a user can choose from.

import { Button } from '@/components/ui/button'
import { Menu, MenuContent, MenuItem } from '@/components/ui/menu'
import { Popover } from '@/components/ui/popover'
<Menu>
  <Button>Open Menu</Button>
  <Popover>
    <MenuContent>
      <MenuItem>Edit</MenuItem>
      <MenuItem>Duplicate</MenuItem>
      <MenuItem>Delete</MenuItem>
    </MenuContent>
  </Popover>
</Menu>

Anatomy

A Menu links a trigger (Button) to an overlay (Popover) that wraps the MenuContent. Each MenuItem auto-wraps string children in a MenuItemLabel; add a MenuItemDescription for secondary text, group items with MenuSection + MenuSectionHeader, and nest a submenu with MenuSub.

import { Button } from '@/components/ui/button'
import {
  Menu,
  MenuContent,
  MenuItem,
  MenuItemLabel,
  MenuItemDescription,
  MenuSection,
  MenuSectionHeader,
  MenuSub,
} from '@/components/ui/menu'
import { Popover } from '@/components/ui/popover'
;<Menu>
  <Button>Open Menu</Button>
  <Popover>
    <MenuContent>
      <MenuItem>
        <MenuItemLabel>Label</MenuItemLabel>
        <MenuItemDescription>Description</MenuItemDescription>
      </MenuItem>
      <MenuSection>
        <MenuSectionHeader>Section</MenuSectionHeader>
        <MenuItem>Item</MenuItem>
      </MenuSection>
      <MenuSub>
        <MenuItem>Submenu</MenuItem>
        <Popover>
          <MenuContent>
            <MenuItem>Nested item</MenuItem>
          </MenuContent>
        </Popover>
      </MenuSub>
    </MenuContent>
  </Popover>
</Menu>

Selection

Set selectionMode to single or multiple on MenuContent to turn items into checkbox or radio items. Control the selection with selectedKeys/onSelectionChange (or defaultSelectedKeys), and disable specific items with disabledKeys.

<MenuContent selectionMode="single" disabledKeys={['right']}>
  <MenuItem id="top">Top</MenuItem>
  <MenuItem id="bottom">Bottom</MenuItem>
  <MenuItem id="right">Right</MenuItem>
</MenuContent>

Pass href to a MenuItem to render it as an <a>; add target for the link target. Client-side routing depends on your router setup.

<MenuItem href="https://twitter.com/mehdibha" target="_blank">
  X
</MenuItem>

Examples

Basic Menu

Account Dropdown

Notification Preferences

Payment Method Selector

Complex Menu

API Reference

A menu displays a list of actions or options that a user can choose. It wraps a trigger element and the menu, linking the menu's open state with the trigger's press state.

PropType
MenuTriggerType

A menu displays a list of actions or options that a user can choose.

PropType
ReactNode | function
Iterable<T>
ReactNode | function
readonly any[]
SelectionMode
Iterable<Key> | "all"
Iterable<Key> | "all"
function
Iterable<Key>
boolean
boolean
"clearSelection" | "none"

A MenuItem represents an individual action in a Menu.

PropType
union
ReactNode | function
Key
boolean
string
T

A MenuItemLabel represents the primary text content of a MenuItem.

PropType

A MenuItemDescription represents secondary text content within a MenuItem.

PropType

A MenuSection represents a section within a Menu.

PropType
Key
T
union
Iterable<T>
readonly any[]
SelectionMode
Iterable<Key> | "all"
Iterable<Key> | "all"
function
boolean

A MenuSectionHeader represents the header of a MenuSection, usually containing the section title.

PropType

A submenu trigger is used to wrap a submenu's trigger item and the submenu itself.

PropType
union
number

Last updated on 7/7/2026