Examples
Label renders a ghost button with a dropdown arrow; each MenuItem takes an Icon, IconColor and OnClick.
Icon renders an IconButton; Dense tightens the rows and a right AnchorOrigin aligns the list to the right edge.
ActivatorContent lets any trigger open the menu through context.ToggleAsync.
Outside a Menu, MenuItem renders a plain row of a daisyUI menu list.
API
<Menu>
DaisyBlazorParameters
- AnchorOrigin Origin= Origin.BottomLeft
Dropdown placement: right origins add dropdown-end, top origins add dropdown-top, CenterLeft / CenterRight open beside the activator (dropdown-left / dropdown-right).
- AriaLabel string= null
Accessible name for the activator. The icon activator falls back to Label, then "Open menu".
- Dense bool= false
Renders compact menu items (menu-sm).
- Icon string= null
Material Symbols ligature for the default icon activator.
- Label string= null
Text label for the default button activator.
- ListClass string= null
Extra CSS classes added to the dropdown menu list.
- Open bool= false
Whether the menu is open. Set it to render the menu expanded; supports @bind-Open.
- Size Size= Size.Medium
Size of the default icon and label activators (btn-sm / btn-lg); ignored by custom activators.
- TransformOrigin Origin= Origin.TopLeft
Which corner of the list sits at the anchor: right origins align the list's right edge (dropdown-end), center origins centre it (dropdown-center), bottom origins open it upward (dropdown-top).
- Class string= null
Extra CSS classes added to the dropdown root.
- Style string= null
Inline CSS style applied to the dropdown root.
Events
- OpenChanged EventCallback<
bool> Raised when the menu opens or closes.
Content
- ActivatorContent RenderFragment<
MenuActivator> Custom activator markup; receives a context with ToggleAsync and IsOpen.
- ChildContent RenderFragment
The MenuItem entries shown in the dropdown list.
<MenuItem>
DaisyBlazorParameters
- Disabled bool= false
Dims the item and blocks activation; a link item also drops its href.
- Href string= null
When set, the item renders as a link to this URL; otherwise as a button.
- Icon string= null
Material Symbols ligature for the leading icon.
- IconColor Color= Color.Inherit
Colour of the leading icon; inherits the text colour by default.
- Target string= null
The link target attribute (e.g. _blank); used only with Href.
- Class string= null
Extra CSS classes added to the item row.
- Style string= null
Inline CSS style applied to the item row.
Events
- OnClick EventCallback<
MouseEventArgs> Raised when the item is activated; the parent Menu then closes.
Content
- ChildContent RenderFragment
The item label rendered after the optional icon.
MenuActivator
DaisyBlazorContext passed to Menu.ActivatorContent. Mirrors the subset of MudBlazor's menu activator context used by consuming markup (notably menu.ToggleAsync).
Methods
- ToggleAsync () → Task
Opens the menu if closed, closes it if open.
From MudMenu
Menu keeps MudMenu's parameter names, so most markup moves over by
dropping the Mud prefix. See the migration guide for the shared enums, icons and services.