Class MudMenu
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
public class MudMenu : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IActivatable
- Inheritance
-
MudMenu
- Implements
- Inherited Members
- Extension Methods
Constructors
MudMenu()
public MudMenu()
Properties
ActivationEvent
Specify the activation event when ActivatorContent is set
[Parameter]
[Category("Behavior")]
public MouseEvent ActivationEvent { get; set; }
Property Value
ActivatorClassname
protected string ActivatorClassname { get; }
Property Value
ActivatorContent
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.
[Parameter]
[Category("Behavior")]
public RenderFragment? ActivatorContent { get; set; }
Property Value
AnchorOrigin
Set the anchor origin point to determine where the popover will open from.
[Parameter]
[Category("Popup appearance")]
public Origin AnchorOrigin { get; set; }
Property Value
AriaLabel
The aria-label
for the menu button when ActivatorContent is not set.
[Parameter]
[Category("Behavior")]
public string? AriaLabel { get; set; }
Property Value
Remarks
Defaults to null
.
ChildContent
Add menu items here
[Parameter]
[Category("Popup behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Color
The color of the button. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color Color { get; set; }
Property Value
Dense
If true, compact vertical padding will be applied to all menu items.
[Parameter]
[Category("Popup appearance")]
public bool Dense { get; set; }
Property Value
Disabled
If true, menu will be disabled.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
DropShadow
Determines whether the component has a drop-shadow. Default is true
[Parameter]
[Category("Appearance")]
public bool DropShadow { get; set; }
Property Value
EndIcon
Icon placed after the text if set.
[Parameter]
[Category("Behavior")]
public string? EndIcon { get; set; }
Property Value
FullWidth
If true, the list menu will be same width as the parent.
[Parameter]
[Category("Popup appearance")]
public bool FullWidth { get; set; }
Property Value
Icon
Icon to use if set will turn the button into a MudIconButton.
[Parameter]
[Category("Behavior")]
public string? Icon { get; set; }
Property Value
IconColor
The color of the icon. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color IconColor { get; set; }
Property Value
Label
[Parameter]
[Category("Behavior")]
public string? Label { get; set; }
Property Value
ListClass
User class names for the list, separated by space
[Parameter]
[Category("Popup appearance")]
public string? ListClass { get; set; }
Property Value
LockScroll
Set to true if you want to prevent page from scrolling when the menu is open
[Parameter]
[Category("Popup appearance")]
public bool LockScroll { get; set; }
Property Value
MaxHeight
Sets the max height the menu can have when open.
[Parameter]
[Category("Popup appearance")]
public int? MaxHeight { get; set; }
Property Value
- int?
Open
Gets a value indicating whether the menu is currently open or not.
public bool Open { get; }
Property Value
OpenChanged
Fired when the menu Open property changes.
[Parameter]
[Category("Popup behavior")]
public EventCallback<bool> OpenChanged { get; set; }
Property Value
PopoverClass
User class names for the popover, separated by space
[Parameter]
[Category("Popup appearance")]
public string? PopoverClass { get; set; }
Property Value
PositionAtCursor
If true, instead of positioning the menu at the left upper corner, position at the exact cursor location. This makes sense for larger activators
[Parameter]
[Category("Popup behavior")]
public bool PositionAtCursor { get; set; }
Property Value
Ripple
Gets or sets whether to show a ripple effect when the user clicks the button. Default is true.
[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }
Property Value
Size
The button Size of the component.
[Parameter]
[Category("Appearance")]
public Size Size { get; set; }
Property Value
StartIcon
Icon placed before the text if set.
[Parameter]
[Category("Behavior")]
public string? StartIcon { get; set; }
Property Value
TransformOrigin
Sets the transform origin point for the popover.
[Parameter]
[Category("Popup appearance")]
public Origin TransformOrigin { get; set; }
Property Value
Variant
The button variant to use.
[Parameter]
[Category("Appearance")]
public Variant Variant { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
CloseMenuAsync()
Closes the menu.
public Task CloseMenuAsync()
Returns
OpenMenuAsync(EventArgs)
Opens the menu.
public Task OpenMenuAsync(EventArgs args)
Parameters
args
EventArgsThe arguments of the calling mouse/pointer event. If PositionAtCursor is true, the menu will be positioned using the coordinates in this parameter.
Returns
ToggleMenuAsync(EventArgs)
Toggle the visibility of the menu.
public Task ToggleMenuAsync(EventArgs args)
Parameters
args
EventArgs