Skip to content
daisyBlazor

NavMenuLink

A Blazor NavLink styled as a daisyUI menu row, for sidebars and nav menus. It highlights itself with menu-active and aria-current="page" when the route matches; it renders its own <li>, so place it directly inside a ul.menu.
Navigation.menuReplaces MudNavLink
Cover · <NavMenuLink>

Examples

Match

Prefix (default) stays active on every page under the Href; NavLinkMatch.All needs an exact match.

website/Examples/Navigation/NavMenuLinkMatchExample.razor Source

Target and disabled

Target opens a link elsewhere; Disabled renders a dimmed, non-clickable row.

website/Examples/Navigation/NavMenuLinkStatesExample.razor Source

API

DaisyBlazor

Parameters

  • Disabled bool
    = false

    Renders a dimmed, non-clickable span instead of a link.

  • Href string
    = null

    Target URL of the link.

  • Icon string
    = null

    Material Symbols icon name rendered before the label at small size.

  • Match NavLinkMatch
    = NavLinkMatch.Prefix

    How the current URL is matched to apply menu-active; defaults to Prefix.

  • Target string
    = null

    The anchor target attribute, e.g. _blank.

  • Class string
    = null

    Extra CSS classes added to the link element.

  • Style string
    = null

    Inline styles applied to the link element.

Content

  • ChildContent RenderFragment

    The link label rendered after the optional icon.

From MudNavLink

NavMenuLink keeps MudNavLink's parameter names, so most markup moves over by dropping the Mud prefix. See the migration guide for the shared enums, icons and services.

Named NavMenuLink rather than NavLink to avoid clashing with the framework's NavLink. Since 0.5 it renders its own <li>: remove any <li> you wrapped it in.

<MudNavLink> <NavMenuLink>
Something went wrong while running the docs. Reload