# Shadcn Nested Submenus

> Context menu with nested submenus.

- Type: example, free and open source (MIT)
- Component: [Context Menu](https://reui.io/components/context-menu.md)
- Page: https://reui.io/components/context-menu/c-context-menu-4
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/context-menu.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/context-menu.md
- MCP: `get_example("c-context-menu-4")`
- Registry item: https://reui.io/r/styles/base-nova/c-context-menu-4.json
- Uses: Context Menu

## Best for

A More Tools flyout of 3 divided groups, Delete last, below 2 clipboard rows with key hints

## When not to use

- A flat list with every action, Delete included, at the top level: use [Destructive Actions](https://reui.io/components/context-menu/c-context-menu-8.md) (`get_example("c-context-menu-8")`)

## Install

```bash
npx shadcn@latest add @reui/c-context-menu-4
```

## About Shadcn Context Menu

### When to use

- Right click actions on a file, row or canvas area, such as copy, paste, share and delete
- Toggles and single choice settings changed from a right click, such as visible bars or the theme
- Long command lists split into headed sections, key hints or a nested flyout of extra tools

### When not to use

- Actions that must stay discoverable, opened from a visible button like a row's more icon: use [Dropdown Menu](https://reui.io/components/dropdown-menu.md) (`get_component("dropdown-menu")`)
- A persistent bar of File, Edit and View lists across the top of an app window: use [Menubar](https://reui.io/components/menubar.md) (`get_component("menubar")`)
- Site links in a header bar whose panels open on hover or click: use [Navigation Menu](https://reui.io/components/navigation-menu.md) (`get_component("navigation-menu")`)

### Agent notes

- Each dashed `ContextMenuTrigger` stands in for your target; wrap the row or card in it, or pass it through `render` on base and `asChild` on radix
- `ContextMenuLabel` throws on the base twin outside a `ContextMenuGroup` or `ContextMenuRadioGroup`; the radix one renders anywhere

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
