Default Light
MgLibrary
Overview
Installation
Buttons
Cards
Charts
Codes
Data Grids
Dropdowns
Editors
Headers & Animations
Icons
Indicators
Inputs
Lists
Modals
Menus
Panels
Pills & Chips
Scheduling
Tabs
Time Line
Trees
Customization

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.

Context Menu

MgContextMenu

Custom right-click menus that can be attached to any element. Supports nested items and icons.

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.
An unhandled error has occurred. Reload 🗙