Skip to content
daisyBlazor

Menu

A dropdown menu: an activator (a labelled button, an icon button, or your own markup) toggles a daisyUI menu of MenuItem rows. Open state lives in C#, an outside click closes it, and choosing an item dismisses it.
Navigation.menuReplaces MudMenu
Cover · <Menu>
Production

Examples

Label activator

Label renders a ghost button with a dropdown arrow; each MenuItem takes an Icon, IconColor and OnClick.

Last action: none yet
website/Examples/Navigation/MenuLabelExample.razor Source

Icon activator

Icon renders an IconButton; Dense tightens the rows and a right AnchorOrigin aligns the list to the right edge.

website/Examples/Navigation/MenuIconExample.razor Source

Custom activator

ActivatorContent lets any trigger open the menu through context.ToggleAsync.

website/Examples/Navigation/MenuActivatorExample.razor Source

Static list

Outside a Menu, MenuItem renders a plain row of a daisyUI menu list.

website/Examples/Navigation/MenuStaticListExample.razor Source

API

<Menu>

DaisyBlazor

Parameters

  • 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>

DaisyBlazor

Parameters

  • 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

DaisyBlazor

Context 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.

<MudMenu> <Menu>
Something went wrong while running the docs. Reload