Skip to content

Menu

Opens a list of actions from a trigger.

menu-basic-demo.tsx

Installation

The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.

Composition

  • MenuTrigger
    • Button
    • MenuPopover
      • PopoverArrowOptional
      • MenuContent

        Owns focus and selection.

        • MenuSectionOptionalRepeats
          • MenuItemRepeats

Icons and shortcuts

Kbd only shows the shortcut. Add the key handler yourself.

menu-demo.tsx

Nested menu

On small screens, the submenu opens below the item.

menu-nested-demo.tsx

Selection

menu-selection-demo.tsx

Sections

Each MenuSection can have its own selectionMode.

menu-sections-demo.tsx

Placement and arrow

Use MenuPopover and MenuContent instead of Menu to set placement.

Quarterly report.pdf

2.4 MB

menu-placement-demo.tsx

API reference

vip/ui adds or changes the props below. For all other props, see React Aria Menu (opens in a new tab).

MenuItem

variant: "default" | "destructive" = "default"
destructive colors the text and icon for an action that deletes or removes data.

MenuSection

title: string
The section heading.