Blazorise Context Menu API

Explore the Blazorise Context Menu API reference for parameters, events, methods, and related types.

For examples and usage guidance, see the Context Menu documentation.

API

Parameters

ContextMenu

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenu.
CloseOnClicktruebool

Closes the menu when a regular item is clicked.
CloseOnEscapetruebool

Closes the menu when pressing the Escape key.
CloseOnOutsideClicktruebool

Closes the menu when clicking outside of it.
Disabledfalsebool

Prevents the menu from opening through its observed target.
SubmenuHoverCloseDelay300int

Delay in milliseconds before hiding a hover-opened submenu after the mouse leaves it.
SubmenuTriggerAllDropdownTrigger

Defines which pointer interactions can open or close nested submenus.
Possible values:NoneClickHoverAll
TargetId—string

Specifies an element id that opens this context menu when right-clicked.
TargetSelector—string

Specifies a CSS selector that opens this context menu when a matching element is right-clicked.
Visiblefalsebool

Gets or sets whether the menu is visible.
Setting this to true opens the menu relative to its configured target. Use Double) to open the menu at a specific viewport position.

ContextMenuToggle

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenuToggle.

ContextMenuBody

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenuBody.

ContextMenuItem

ParameterDefaultType
Activefalsebool

Indicates the currently active item.
Checkedfalsebool

Tracks the checked state whenever the item is in checkbox mode.
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenuItem.
Disabledfalsebool

Indicates the currently disabled item.
Iconnullobject

Specifies the icon to render before the item content.
Shortcut—string

Specifies shortcut text rendered at the end of the item.
ShowCheckboxfalsebool

The item renders a checkbox.
Valuenullobject

Holds the item value.

ContextMenuToolbar

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenuToolbar.

ContextMenuToolbarItem

ParameterDefaultType
Activefalsebool

Indicates the currently active item.
Disabledfalsebool

Indicates the currently disabled item.
EndAlignedfalsebool

Pushes this item and any following items to the logical end of the toolbar.
Iconnullobject

Specifies the icon to render inside the toolbar item.
ShowTextfalsebool

Indicates whether Text should be rendered visibly next to the icon.
Text—string

Specifies the toolbar item text. It is used as the default title and aria-label.
Valuenullobject

Holds the item value.

ContextMenuHeader

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenuHeader.

ContextMenuGroup

ParameterDefaultType
CheckModeContextMenuCheckMode.NoneContextMenuCheckMode

Defines how child items handle checked state.
Possible values:NoneRadio
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenuGroup.
SelectedValuenullobject

Gets or sets the currently selected value when CheckMode is Radio.

ContextMenuSubmenu

ParameterDefaultType
ChildContentnullRenderFragment

Specifies the content to be rendered inside this ContextMenuSubmenu.
Disabledfalsebool

Indicates the submenu is disabled.
HoverCloseDelay300int?

Delay in milliseconds before hiding this hover-opened submenu after the mouse leaves it.
When omitted, uses the parent ContextMenu submenu close delay, falling back to 300 ms.
Iconnullobject

Specifies the icon to render before the submenu label.
Text—string

Specifies the submenu label.
TriggerAllDropdownTrigger?

Defines which pointer interactions can open or close this submenu.
When omitted, uses the parent ContextMenu submenu trigger, falling back to All.

Events

ContextMenu

EventType
ClosedEventCallback<ContextMenuEventArgs>

Occurs after the menu closes.
ClosingFunc<ContextMenuClosingEventArgs, Task>

Callback invoked before the menu closes. Set Cancel to prevent closing.
OpenedEventCallback<ContextMenuEventArgs>

Occurs after the menu body has rendered and its initial position has been applied.
OpeningFunc<ContextMenuOpeningEventArgs, Task>

Callback invoked before the menu opens. Set Cancel to prevent opening.
VisibleChangedEventCallback<bool>

Notifies when the effective menu visibility changes or a canceled request must be synchronized.

ContextMenuItem

EventType
CheckedChangedEventCallback<bool>

Occurs after the checked state changes whenever the item is in checkbox mode.
ClickedEventCallback<object>

Notifies when the item is clicked.

ContextMenuToolbarItem

EventType
ClickedEventCallback<object>

Notifies when the toolbar item is clicked.

ContextMenuGroup

EventType
SelectedValueChangedEventCallback<object>

Occurs after the selected value changes.

Methods

ContextMenu

MethodReturnParameters
HideTask—

Hides the context menu.
RepositionTask—

Repositions the visible context menu relative to its configured target.
This method does nothing while the menu is hidden and does not invoke Opening, Opened, or VisibleChanged.
RepositionTaskdouble clientX, double clientY

Repositions the visible context menu at the supplied viewport coordinates.
This method does nothing while the menu is hidden and does not invoke Opening, Opened, or VisibleChanged.
ShowTask—

Opens the context menu relative to its configured target.
This method does nothing while the menu is visible. Use Reposition to update its position.
ShowTaskdouble clientX, double clientY

Opens the context menu at the supplied viewport coordinates.
This method does nothing while the menu is visible. Use Double) to update its position.