---
title: "Menu"
description: "A list of actions that opens from a button. It holds items with icons and keys, links, checkboxes, radio choices, submenus, and a filter field."
url: https://gelatinui.com/components/menu
markdown_url: https://gelatinui.com/components/menu.md
access: free
install: "npx shadcn@latest add @gelatin-ui/menu"
registry_item: https://gelatinui.com/r/menu.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Menu

> A list of actions that opens from a button. It holds items with icons and keys, links, checkboxes, radio choices, submenus, and a filter field.

Page: https://gelatinui.com/components/menu

## When to use it

Best for: A list of actions that opens from a button: items, links, toggles, radio choices, submenus, and a filter field.

- Use it for a list of actions that opens from a button.
- Use `MenuCheckboxItem` and `MenuRadioGroup` for settings. They stay open on a click.
- Use `MenuSub` for nested actions.
- Use `MenuFilter` with `MenuInput` and `MenuList` for a long list.
- Use `MenuLinkItem` for a link. Render a router link through `render`.

## When not to use it

- To pick a form value, use a [Select](https://gelatinui.com/components/select.md).
- For actions at the pointer on a right click, use a [Context Menu](https://gelatinui.com/components/context-menu.md).
- For a popup with other content than actions, use a [Popover](https://gelatinui.com/components/popover.md).

## Notes for agents

- Render a Button through `render` on `MenuTrigger`.
- Give an item `label` when it has a `MenuShortcut` or rich children. Type-ahead and the filter then match the name, not the keys.
- `MenuShortcut` is text only. The menu does not bind the keys.
- `modal` is `true` by default. Set `modal={false}` to keep the page active.
- For a few short steps of one setting in one row with a sliding pill, add `menu-segmented-radio-group` and use `MenuSegmentedRadioGroup`.
- `MenuInput` needs a `MenuFilter` around the menu, and an `aria-label`.
- `MenuFilter` highlights the first match by default, so Enter runs it. `autoHighlight` changes this.
- A `MenuLinkItem` stays open on a click by default, so a new-tab link does not close the menu.
- Use `createMenuHandle` to open one menu from several triggers.
- A `render` prop of your own on `MenuContent` replaces the Motion element.

## Anatomy

```text
Menu
├─ MenuTrigger (0..n)
├─ MenuContent (0..n)
├─ MenuViewport (0..n)
├─ MenuInput (0..n)
├─ MenuList (0..n)
├─ MenuEmpty (0..n)
├─ MenuGroup (0..n)
├─ MenuGroupLabel (0..n)
├─ MenuItem (0..n)
├─ MenuLinkItem (0..n)
├─ MenuCheckboxItem (0..n)
├─ MenuRadioGroup (0..n)
├─ MenuRadioItem (0..n)
├─ MenuShortcut (0..n)
├─ MenuSeparator (0..n)
├─ MenuSub (0..n)
├─ MenuSubTrigger (0..n)
└─ MenuSubContent (0..n)
```

## API reference

### Menu

Also takes every prop of Base UI `Menu.Root`: https://base-ui.com/react/components/menu

### MenuFilter

Also takes every prop of Base UI `Menu.FilterProvider`: https://base-ui.com/react/components/menu

### MenuTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Menu.Trigger`: https://base-ui.com/react/components/menu

### MenuContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `arrow` | `boolean` | false | Show an arrow that points at the trigger. The gap grows from 4px to 8px. |
| `backdrop` | `boolean` | false | Put a clear layer under the popup (Base UI `Menu.Backdrop`), for example to dim it. |
| `portalProps` | `Omit` |  | Other Base UI props of the inner parts. A `className` here adds to the component classes. |
| `positionerProps` | `PopupPartProps` |  |  |
| `backdropProps` | `PopupPartProps<MenuBackdropProps>` |  |  |
| `arrowProps` | `PopupPartProps<MenuArrowProps>` |  |  |

Also takes every prop of Base UI `Menu.Popup`: https://base-ui.com/react/components/menu

### MenuInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `clearLabel` | `string` | "Clear filter" | The accessible name of the clear button. Translate it with the page. |
| `clearProps` | `PopupPartProps<MenuClearProps>` |  | Other Base UI props of the clear button (`Menu.Clear`). |

### MenuGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Menu.Group`: https://base-ui.com/react/components/menu

### MenuGroupLabel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `inset` | `boolean` | false | Line the label up with item text that follows a 16px slot (a check or an icon). |

### MenuItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` |  |  |
| `variant` | `"default" \| "destructive"` |  |  |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Menu.Item`: https://base-ui.com/react/components/menu

### MenuLinkItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `inset` | `boolean` |  |  |
| `variant` | `"default" \| "destructive"` |  |  |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Menu.LinkItem`: https://base-ui.com/react/components/menu

### MenuCheckboxItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `indicator` | `"check" \| "switch"` | "check" | The mark of the setting. `check` (default): a check in the 16px start slot. `switch`: the Switch look at the inline end, for a setting that reads as on or off ("Thinking", "Web search"), with no start slot. The item is still one `menuitemcheckbox`: the switch is drawn by two `CheckboxItemIndicator` parts that stay mounted, so it reads the item state (`data-checked`) with no second control inside the item. A disabled item dims once: the row is at 50%, and the switch keeps full opacity inside it (the Switch component would dim it again to 25%). |
| `indeterminate` | `boolean` |  | Some, not all (with `indicator="check"`): a dash in the start slot and `aria-checked="mixed"`, for an "All" item over a list of items where only some are on (the Source Picker). Pass it with `checked={false}`: a press then calls `onCheckedChange(true)`, so a mixed item turns all on, as a tri-state checkbox does. The dash fades on the `fade` token, as the check. |

Also takes every prop of Base UI `Menu.CheckboxItem`: https://base-ui.com/react/components/menu

### MenuRadioGroup

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |

Also takes every prop of Base UI `Menu.RadioGroup`: https://base-ui.com/react/components/menu

### MenuRadioItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `indicator` | `"dot" \| "end-check"` | "dot" | The mark of the chosen item. `dot` (default): an 8px dot in the 16px start slot. `end-check`: a check in a 16px slot at the inline end, with no start slot, for rich rows that lead with their own icon or logo (a model, an account). The slot pushes itself to the end (`ms-auto`); with a value before it, let the text grow (`flex-1`), or two auto margins share the room. |

Also takes every prop of Base UI `Menu.RadioItem`: https://base-ui.com/react/components/menu

### MenuShortcut

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### MenuSeparator

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `variant` | `"dashed" \| "dotted" \| "double" \| "fade" \| "solid"` |  | The line pattern. Default: `solid`. |
| `tone` | `"default" \| "destructive" \| "info" \| "muted" \| "primary" \| "success" \| "warning"` |  | The color, from the shared tokens. Default: `default` (the border color). |
| `children` | `ReactNode` |  | Content in the middle of a horizontal line: "or", a date, an icon. The line then splits in two halves around it, and a text label is the name that screen readers hear. |

Also takes every prop of Base UI `Separator`: https://base-ui.com/react/components/separator

### MenuSub

Also takes every prop of Base UI `Menu.SubmenuRoot`: https://base-ui.com/react/components/menu

### MenuSubTrigger

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `inset` | `boolean` |  | Line the text up with items that have a 16px slot. |

Also takes every prop of Base UI `Menu.SubmenuTrigger`: https://base-ui.com/react/components/menu

### MenuSubContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `arrow` | `boolean` | false | Show an arrow that points at the trigger. The gap grows from 4px to 8px. |
| `portalProps` | `Omit` |  | Other Base UI props of the inner parts. A `className` here adds to the component classes. |
| `positionerProps` | `PopupPartProps` |  |  |
| `arrowProps` | `PopupPartProps<MenuArrowProps>` |  |  |

Also takes every prop of Base UI `Menu.Popup`: https://base-ui.com/react/components/menu

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| MenuTrigger | `menu-trigger` | `data-disabled` |  |  |
| MenuContent | `menu-content` |  | `--available-height`, `--available-width` |  |
| MenuViewport | `menu-viewport` |  |  |  |
| MenuInput | `menu-input` |  |  |  |
| MenuList | `menu-list` |  |  |  |
| MenuEmpty | `menu-empty` |  |  |  |
| MenuGroup | `menu-group` |  |  |  |
| MenuGroupLabel | `menu-group-label` |  |  |  |
| MenuItem | `menu-item` | `data-highlighted`, `data-icon-color`, `data-variant` |  | `status-colors` |
| MenuLinkItem | `menu-link-item` | `data-highlighted`, `data-icon-color`, `data-variant` |  | `status-colors` |
| MenuCheckboxItem | `menu-checkbox-item` | `data-disabled`, `data-ending-style`, `data-hidden`, `data-highlighted`, `data-icon-color`, `data-starting-style`, `data-variant` |  | `motion-timing`, `status-colors` |
| MenuRadioGroup | `menu-radio-group` |  |  |  |
| MenuRadioItem | `menu-radio-item` | `data-ending-style`, `data-highlighted`, `data-icon-color`, `data-starting-style`, `data-unchecked`, `data-variant` |  | `motion-timing`, `status-colors` |
| MenuShortcut | `menu-shortcut` |  |  |  |
| MenuSeparator | `menu-separator` |  |  |  |
| MenuSub | `menu-sub` |  |  |  |
| MenuSubTrigger | `menu-sub-trigger` | `data-highlighted`, `data-icon-color`, `data-popup-open`, `data-variant` |  | `status-colors` |
| MenuSubContent | `menu-sub-content` |  | `--available-height`, `--available-width` |  |

## Usage

Render a `Button` through `render` on `MenuTrigger`. Give an item `label` when it has a `MenuShortcut`, so type-ahead matches the name.

The sample also uses `button`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/menu @gelatin-ui/button
```

```tsx title="edit-menu.tsx"
import { Button } from "@/components/ui/button";
import { Menu, MenuContent, MenuItem, MenuSeparator, MenuTrigger } from "@/components/ui/menu";

export function EditMenu() {
  return (
    <Menu>
      <MenuTrigger render={<Button variant="outline" />}>Edit</MenuTrigger>
      <MenuContent>
        <MenuItem>Rename</MenuItem>
        <MenuItem>Duplicate</MenuItem>
        <MenuSeparator />
        <MenuItem variant="destructive">Delete</MenuItem>
      </MenuContent>
    </Menu>
  );
}
```

## Compose

Build it with:

- [Filters](https://gelatinui.com/components/filters.md): Narrows the records.
- [Data Table](https://gelatinui.com/components/data-table.md): Shows the records in rows, with sort and select.
- [Badge](https://gelatinui.com/components/badge.md): Shows the status of each record.
- [Pagination](https://gelatinui.com/components/pagination.md): Moves between pages.
- [Empty](https://gelatinui.com/components/empty.md): Shows when no record matches, with a next action.
- [Skeleton](https://gelatinui.com/components/skeleton.md): Holds the layout while the rows load.
- [Sidebar](https://gelatinui.com/components/sidebar.md): Holds the groups of links and collapses to icons.
- [Avatar](https://gelatinui.com/components/avatar.md): Shows the signed-in person in the footer.

Rules:

- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.
- Color has a job (`color-has-a-job`): Use color only for a status, the brand action, or data; keep the rest neutral, and show a level with a small mark (a dot, a tinted badge) before a big fill.
- Real content (`real-content`): Fill the UI with content of the real product (real names, amounts, dates, and states), never lorem text or "Item 1".
- Steady text weight (`steady-weight`): Never change the font weight on hover, focus, selected, active, or open; change the color or the fill, so the text does not jump.

Patterns: `gelatin://patterns/data-list`, `gelatin://patterns/app-sidebar`

## Add it

```bash
npx shadcn@latest add @gelatin-ui/menu
```

It adds 19 registry items: 16 files, 3308 lines, and the npm packages `@base-ui/react`, `@phosphor-icons/react`, `clsx`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Separator](https://gelatinui.com/components/separator.md)
- [Switch](https://gelatinui.com/components/switch.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Context Menu](https://gelatinui.com/components/context-menu.md): Pick Context Menu for the same actions at the pointer on a right click or a long press, as a second way in.
- [Popover](https://gelatinui.com/components/popover.md)
- [Select](https://gelatinui.com/components/select.md): Pick Select to set a value that a form sends, not to run an action.
- [Command](https://gelatinui.com/components/command.md): Pick Command for a search field over many commands, such as a command palette or a quick switcher.

## Keyboard

| Keys | Action |
| --- | --- |
| Enter, Space | On the trigger: opens the menu. |
| Arrow Down, Arrow Up | On the trigger, opens the menu. In the menu, moves to the next or the previous item. |
| Home, End | Moves to the first or the last item. |
| Enter, Space | On an item: runs the item, or changes a check or a radio choice. |
| Letter keys | Moves to the item whose text starts with the typed letters. |
| Arrow Right | Opens a submenu. In right to left, use Arrow Left. |
| Arrow Left | Closes a submenu. In right to left, use Arrow Right. |
| Escape | Closes the menu. In a submenu it closes only the submenu, unless `closeParentOnEsc` is set. |

## Accessibility

It is a Base UI Menu. The popup has the `menu` role, and the arrow keys move between items.

A letter key jumps to the item that starts with it.

`MenuInput` needs an `aria-label`. `MenuShortcut` is text only: the menu does not bind the keys.

## Motion

| Part | Motion |
| --- | --- |
| Open | popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1) · fades in and scales from 95% |
| Close | popup-exit · 120ms · ease-out (0, 0, 0.2, 1) |
