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
MudNavLink()
public MudNavLink()
Properties
ActiveClass
The CSS applied when this link is active.
[Parameter]
[Category("Common")]
public string ActiveClass { get; set; }
Property Value
Remarks
Defaults to active
. Multiple classes must be separated by spaces.
Attributes
protected Dictionary<string, object?> Attributes { get; }
Property Value
ChildContent
The content within this link.
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Disabled
Prevents the user from interacting with this link.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
ForceLoad
Performs a full page load during navigation.
[Parameter]
[Category("Click action")]
public bool ForceLoad { get; set; }
Property Value
Remarks
Defaults to false
. When true
, client-side routing is bypassed and the browser is forced to load the new page from the server.
Href
The URL to navigate to when this link is clicked.
[Parameter]
[Category("Click action")]
public string? Href { get; set; }
Property Value
Icon
The icon displayed for this link.
[Parameter]
[Category("Behavior")]
public string? Icon { get; set; }
Property Value
Remarks
Defaults to null
.
IconClassname
protected string IconClassname { get; }
Property Value
IconColor
The color of the icon when Icon is set.
[Parameter]
[Category("Appearance")]
public Color IconColor { get; set; }
Property Value
Remarks
Defaults to Default.
LinkClassname
protected string LinkClassname { get; }
Property Value
Match
Controls when this link is highlighted.
[Parameter]
[Category("Behavior")]
public NavLinkMatch Match { get; set; }
Property Value
Remarks
Defaults to Prefix. This link is compared against the current URL to determine whether it is highlighted.
OnClick
Occurs when this link has been clicked.
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }
Property Value
Remarks
This event only occurs when the Href property has not been set.
Ripple
Shows a ripple effect when the user clicks this link.
[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }
Property Value
Remarks
Defaults to true
.
TabIndex
protected int TabIndex { get; }
Property Value
Target
The browser frame to open this link when Href is specified.
[Parameter]
[Category("Click action")]
public string? Target { get; set; }
Property Value
Remarks
Possible values include _blank
, _self
, _parent
, _top
, or a frame name.
Defaults to null
.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
HandleNavigation()
protected Task HandleNavigation()
Returns
OnClickHandler(MouseEventArgs)
protected Task OnClickHandler(MouseEventArgs ev)