Table of Contents

Class MudNavLink

Namespace
MudBlazor
Assembly
MudBlazor.dll

A navigation link as part of a MudNavMenu.

public class MudNavLink : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
Inheritance
MudNavLink
Implements
Inherited Members
Extension Methods

Constructors

public MudNavLink()

Properties

The CSS applied when this link is active.

[Parameter]
[Category("Common")]
public string ActiveClass { get; set; }

Property Value

string

Defaults to active. Multiple classes must be separated by spaces.

protected Dictionary<string, object?> Attributes { get; }

Property Value

Dictionary<string, object>

The content within this link.

[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment
protected string Classname { get; }

Property Value

string

Prevents the user from interacting with this link.

[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }

Property Value

bool

Performs a full page load during navigation.

[Parameter]
[Category("Click action")]
public bool ForceLoad { get; set; }

Property Value

bool

Defaults to false. When true, client-side routing is bypassed and the browser is forced to load the new page from the server.

The URL to navigate to when this link is clicked.

[Parameter]
[Category("Click action")]
public string? Href { get; set; }

Property Value

string

The icon displayed for this link.

[Parameter]
[Category("Behavior")]
public string? Icon { get; set; }

Property Value

string

Defaults to null.

protected string IconClassname { get; }

Property Value

string

The color of the icon when Icon is set.

[Parameter]
[Category("Appearance")]
public Color IconColor { get; set; }

Property Value

Color

Defaults to Default.

protected string LinkClassname { get; }

Property Value

string

Controls when this link is highlighted.

[Parameter]
[Category("Behavior")]
public NavLinkMatch Match { get; set; }

Property Value

NavLinkMatch

Defaults to Prefix. This link is compared against the current URL to determine whether it is highlighted.

Occurs when this link has been clicked.

[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

This event only occurs when the Href property has not been set.

Shows a ripple effect when the user clicks this link.

[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }

Property Value

bool

Defaults to true.

protected int TabIndex { get; }

Property Value

int

The browser frame to open this link when Href is specified.

[Parameter]
[Category("Click action")]
public string? Target { get; set; }

Property Value

string

Possible values include _blank, _self, _parent, _top, or a frame name.
Defaults to null.

Methods

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder
protected Task HandleNavigation()

Returns

Task
protected Task OnClickHandler(MouseEventArgs ev)

Parameters

ev MouseEventArgs

Returns

Task

See Also