MudMenu API

Pages
Properties
Name Type Default Description
Behavior
ActivationEvent
MouseEvent
MouseEvent.LeftClick Specify the activation event when ActivatorContent is set
ActivatorContent
RenderFragment
null Place a MudButton, a MudIconButton or any other component capable of acting as an activator. This will override the standard button and all parameters which concern it.
Disabled
bool
False If true, menu will be disabled.
EndIcon
string
null Icon placed after the text if set.
Icon
string
null Icon to use if set will turn the button into a MudIconButton.
Label
string
null
StartIcon
string
null Icon placed before the text if set.
Appearance
Color
Color
Color.Default The color of the button. It supports the theme colors.
DisableElevation
bool
False If true, no drop-shadow will be used.
DisableRipple
bool
False If true, disables ripple effect.
IconColor
Color
Color.Inherit The color of the icon. It supports the theme colors.
Size
Size
Size.Medium The button Size of the component.
Variant
Variant
Variant.Text The button variant to use.
Popup behavior
ChildContent
RenderFragment
null Add menu items here
PositionAtCursor
bool
False If true, instead of positioning the menu at the left upper corner, position at the exact cursor location. This makes sense for larger activators
Popup appearance
AnchorOrigin
Origin
Origin.TopLeft Set the anchor origin point to determen where the popover will open from.
Dense
bool
False If true, compact vertical padding will be applied to all menu items.
FullWidth
bool
False If true, the list menu will be same width as the parent.
ListClass
string
null User class names for the list, separated by space
LockScroll
bool
False Set to true if you want to prevent page from scrolling when the menu is open
MaxHeight
int?
null Sets the maxheight the menu can have when open.
PopoverClass
string
null User class names for the popover, separated by space
TransformOrigin
Origin
Origin.TopLeft Sets the transform origin point for the popover.
Common
Class
string
null User class names, separated by space.
Style
string
null User styles, applied on top of the component's own classes and styles.
Tag
object
null Use Tag to attach any user data object to the component for your convenience.
UserAttributes
Dictionary<string, object>
UserAttributes carries all attributes you add to the component that don't match any of its parameters. They will be splatted onto the underlying HTML tag.
EventCallbacks
Name Type Description
IsOpenChanged EventCallback<bool> Fired when the menu IsOpen property changes.
Methods
Name Parameters Return Description
Activate(object activator, MouseEventArgs args)
object activator
MouseEventArgs args
Implementation of IActivatable.Activate, toggles the menu.
Activate(object activator, TouchEventArgs args)
object activator
TouchEventArgs args
Implementation of IActivatable.Activate, toggles the menu.
CloseMenu() Closes the menu.
MouseEnter(MouseEventArgs args)
MouseEventArgs args
MouseLeave()
OpenMenu(EventArgs args)
EventArgs args : The arguments of the calling mouse event. If <see cref="P:MudBlazor.MudMenu.PositionAtCursor" /> is true, the menu will be positioned using the coordinates in this parameter.
Opens the menu.
ToggleMenu(EventArgs args)
EventArgs args : Either <see cref="T:Microsoft.AspNetCore.Components.Web.MouseEventArgs" /> or <see cref="T:Microsoft.AspNetCore.Components.Web.TouchEventArgs" />
Toggle the visibility of the menu.

Copyright © 2020-2024 MudBlazor.

Powered by .NET 8.0.8

An error has occurred. This application may no longer respond until reloaded. Reload 🗙