Context Menu
Context Menu
Displays a menu to the user — such as a set of actions or functions — triggered by a button or right-click.
Default
Right-click the area below to open the context menu.
With Icons
Add Lucide icons to context menu items for improved usability.
With Labels and Groups
Organize menu items using labels and separators.
With Destructive Item
Destructive actions are styled to draw attention to their danger.
With Inset Items
Use Inset to align items that don't have an icon with items that do.
On Image
Context menus can be triggered on any element, including images.
With Checkbox Items
Toggle states using checkbox menu items.
Toolbar: on
Sidebar: off
Status Bar: on
With Radio Items
Single-selection using radio menu items.
View mode: grid
With Submenus
Organize complex menus with nested submenus.
Features
- Opens on right-click (contextmenu event)
- Positioned at mouse cursor location
- Closes on outside click or Escape key
- Full keyboard navigation (↑/↓, Enter, Escape)
- Support for disabled items
- Keyboard shortcut hints
- Separator and label components
Keyboard Navigation
↑/↓
Navigate items
Enter/Space
Select item
Escape
Close menu
API Reference
Component parameters and their types.
| Prop | Type | Default | Description |
|---|---|---|---|
| ChildContent | RenderFragment? | null | ContextMenuTrigger and ContextMenuContent. |
| Disabled | bool | false | On ContextMenuItem: prevents interaction when true. |
| Inset | bool | false | On ContextMenuItem/Label: adds left padding to align with icon items. |
| Checked | bool | false | On ContextMenuCheckboxItem: the checked state. Use @bind-Checked. |
| Value | TValue | — | On ContextMenuRadioItem: the value this item represents. |
| Class | string? | null | Additional CSS classes. |
| OnClick | EventCallback | — | On ContextMenuItem: callback invoked when the item is clicked. |