RadzenLink Class

A hyperlink component for navigation within the application or to external URLs. RadzenLink provides styled links with icon support, active state highlighting, and disabled states. Enables navigation styled according to the application theme. Supports internal navigation using Path for Blazor routing without page reloads, external links opening in same or new window via Target property, automatic highlighting when the current URL matches the link path, optional icon before text via Icon property, alternative icon using custom image via Image property, disabled state that prevents navigation and changes visual appearance, and prefix or exact matching for active state detection. For internal navigation, uses Blazor's NavigationManager for client-side routing. For external URLs, use Target="_blank" to open in a new tab.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenLink

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenLink : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender

Examples

Internal navigation link:

<RadzenLink Path="/products" Text="View Products" Icon="shopping_cart" />

External link opening in new tab:

<RadzenLink Path="https://radzen.com" Text="Visit Radzen" Target="_blank" Icon="open_in_new" />

Link with custom content:

<RadzenLink Path="/dashboard">
    <RadzenIcon Icon="dashboard" /> Go to Dashboard
</RadzenLink>

Constructors

Properties

ChildContentlink

Gets or sets custom child content to render as the link content. When set, overrides the Text property for complex link content with custom markup.

Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type Description
RenderFragmentGets or sets custom child content to render as the link content. When set, overrides the Text property for complex link content with custom markup.

Disabledlink

Gets or sets whether the link is disabled and cannot be clicked. When disabled, the link appears grayed out and does not navigate.

Declaration
public bool Disabled { get; set; }
Property Value
Type Description
boolGets or sets whether the link is disabled and cannot be clicked. When disabled, the link appears grayed out and does not navigate.

Iconlink

Gets or sets the Material icon name to display before the link text. Use Material Symbols icon names (e.g., "home", "settings", "open_in_new").

Declaration
public string Icon { get; set; }
Property Value
Type Description
stringGets or sets the Material icon name to display before the link text. Use Material Symbols icon names (e.g., "home", "settings", "open_in_new").

IconColorlink

Gets or sets a custom color for the icon. Supports any valid CSS color value. If not set, icon inherits the link color.

Declaration
public string IconColor { get; set; }
Property Value
Type Description
stringGets or sets a custom color for the icon. Supports any valid CSS color value. If not set, icon inherits the link color.

Imagelink

Gets or sets a custom image URL to display before the link text instead of an icon. Alternative to using Icon for custom graphics.

Declaration
public string Image { get; set; }
Property Value
Type Description
stringGets or sets a custom image URL to display before the link text instead of an icon. Alternative to using Icon for custom graphics.

ImageAlternateTextlink

Gets or sets the alternate text for the image when using the Image property. Provides accessibility text for screen readers when an image is used instead of an icon.

Declaration
public string ImageAlternateText { get; set; }
Property Value
Type Description
stringGets or sets the alternate text for the image when using the Image property. Provides accessibility text for screen readers when an image is used instead of an icon.

Matchlink

Gets or sets how the link's active state is determined by comparing the current URL to the link path. Prefix matches when URL starts with path, All requires exact match.

Declaration
public Routing.NavLinkMatch Match { get; set; }
Property Value
Type Description
Routing.NavLinkMatchGets or sets how the link's active state is determined by comparing the current URL to the link path. Prefix matches when URL starts with path, All requires exact match.

Pathlink

Gets or sets the URL path for navigation. Can be a relative path for internal navigation (e.g., "/products") or an absolute URL for external sites.

Declaration
public string Path { get; set; }
Property Value
Type Description
stringGets or sets the URL path for navigation. Can be a relative path for internal navigation (e.g., "/products") or an absolute URL for external sites.

Targetlink

Gets or sets the target window or frame for the link navigation. Use "_blank" for new tab, "_self" for same window, or custom frame names.

Declaration
public string Target { get; set; }
Property Value
Type Description
stringGets or sets the target window or frame for the link navigation. Use "_blank" for new tab, "_self" for same window, or custom frame names.

Textlink

Gets or sets the link text to display. For simple text links, use this property. For complex content, use ChildContent instead.

Declaration
public string Text { get; set; }
Property Value
Type Description
stringGets or sets the link text to display. For simple text links, use this property. For complex content, use ChildContent instead.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetPathlink

Gets the path.

Declaration
protected string GetPath()
Returns
Type Description
string

GetTargetlink

Gets the target.

Declaration
protected string GetTarget()
Returns
Type Description
string
An error has occurred. This app may no longer respond until reloaded. Reload 🗙