Context Menu
Custom right-click menus that can be attached to any element. Supports nested items and icons.
Use this example to explore default behavior, customization points, and accessibility-friendly patterns in a real Blazor page.
API Reference
MgContextMenu
| Property | Type | Default | Description |
|---|---|---|---|
| ContextItemClicked | EventCallback<MgContextItem> | - | Triggered when a context item is clicked. |
| CanShow | bool | false | Control whether the context menu is currently shown. |
| XPosition | double | 0 | Optional X coordinate for menu placement. |
| YPosition | double | 0 | Optional Y coordinate for menu placement. |
MgContextItem
| Property | Type | Default | Description |
|---|---|---|---|
| ItemClicked | EventCallback<MgContextItem> | - | Optional callback when the item is clicked. |
| DisplayText | string | "" | Text displayed for the context menu item. |
| IconName | string | null | Optional icon to display with the item. |