# Shadcn Context Menu

> Open-source shadcn context menu components for right-click menus, file actions, and table row actions.

- Type: shadcn/ui component, free
- Page: https://web.dev.reui.io/components/context-menu
- 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_component("context-menu")`, then `get_examples("context-menu")`
- Examples: 10

## 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://web.dev.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://web.dev.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://web.dev.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

## Examples

- [Basic](https://web.dev.reui.io/components/context-menu/c-context-menu-1.md): Basic context menu.. Best for the bare minimum of 3 plain text rows in a single group, with the middle row disabled.
- [Icons](https://web.dev.reui.io/components/context-menu/c-context-menu-2.md): Context menu with icons for common actions.. Best for clipboard commands, Copy, Cut and Paste, each with a leading icon, and a destructive Delete below a divider.
- [Shortcuts](https://web.dev.reui.io/components/context-menu/c-context-menu-3.md): Context menu with keyboard shortcuts.. Best for navigation and save commands with a trailing key hint on each row and Forward disabled.
- [Nested Submenus](https://web.dev.reui.io/components/context-menu/c-context-menu-4.md): Context menu with nested submenus.. Best for a More Tools flyout of 3 divided groups, Delete last, below 2 clipboard rows with key hints.
- [Labels & Separators](https://web.dev.reui.io/components/context-menu/c-context-menu-5.md): Context menu labels and separators.. Best for a list of 4 groups, File and Edit headed by labels, with a key hint on every row down to a destructive Delete.
- [Checkbox Items](https://web.dev.reui.io/components/context-menu/c-context-menu-6.md): Context menu with checkbox items.. Best for a list of 3 browser view toggles that show a check when on, 2 of them on at load.
- [Radio Items](https://web.dev.reui.io/components/context-menu/c-context-menu-7.md): Context menu with radio items.. Best for a person picker and a Light, Dark or System theme switch, each a headed radio set held in state.
- [Destructive Actions](https://web.dev.reui.io/components/context-menu/c-context-menu-8.md): Context menu with destructive actions.. Best for edit and Share over a divider, then Archive and a destructive Delete, every row led by an icon.
- [Alignment Sides](https://web.dev.reui.io/components/context-menu/c-context-menu-9.md): Context menu with different alignment sides.. Best for a row of 6 triggers that each open on a different side, the logical inline start and end included.
- [Inside Dialog](https://web.dev.reui.io/components/context-menu/c-context-menu-10.md): Context menu used inside a dialog component.. Best for a right click area inside a modal window, with icon rows, a More Options flyout and a destructive Delete.

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