GitHub

Menu

A list of options that appears when a user interacts with a button

Installation

Usage

Positioning

Control the position of the menu relative to the trigger using the positioning prop.

Examples

Nested Menu

Use <MenuSub />, <MenuSubTrigger />, and <MenuSubContent /> for nested submenus.

Icons

Combine icons with labels for quick scanning.

Shortcuts

Use <MenuShortcut /> to show keyboard hints next to menu items.

Checkboxes

Use <MenuCheckboxItem /> for toggles.

Radio Group

Use <MenuRadioGroup /> and <MenuRadioItem /> for a single selection from a set of options.

Use the asChild prop on <MenuItem /> with a anchor element to render a link.

With Group Label

Use <MenuGroup /> with <MenuGroupLabel /> or the heading prop to group related items under a label.

Open a Dialog

Open a dialog from a <MenuItem /> with the onClick prop and controlled state.

Destructive

Use variant="destructive" on <MenuItem /> for irreversible actions like delete.

API Reference

Root element of the menu component.

Button that opens the menu. Renders a button. Use asChild to delegate to a child element.

Content container for menu items. Renders a div inside a portal.

A single menu option. Renders a div (or child when asChild).

A menu option with a checkbox. Use checked and onCheckedChange for controlled state.

Group of mutually exclusive options. Use value and onValueChange for controlled state.

A single option in a radio group.

Groups related items. Use heading or <MenuGroupLabel /> for a label.

Label for a group. Renders inside <MenuGroup />.

Visual divider between items. Renders an hr.

Submenu: wrap a nested <Menu />-like structure. <MenuSubTrigger /> opens the submenu; <MenuSubContent /> holds the nested items.

Optional keyboard hint shown next to an item (e.g. ⌘S). Renders a span.


For a complete list of props, see the Ark UI documentation.