Table of Contents

Class TwLink

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll
public class TwLink : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent
Inheritance
TwLink
Implements
Inherited Members

Constructors

public TwLink()

Properties

The child content of the link element.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Gets or sets the semantic colour of the link.

[Parameter]
public Color? Color { get; set; }

Property Value

Color?

When neither Color nor Tone is set, a link without a custom Class uses the theme's primary text colour. A custom class replaces that default look, so links used inside a button keep the button's own colour; an explicit colour or tone is still applied.

Gets or sets the URL that the hyperlink points to.

[Parameter]
public string Href { get; set; }

Property Value

string

Gets or sets the relationship between the linked resource and the current document.

[Parameter]
public string? Rel { get; set; }

Property Value

string

When not set and Target is "_blank", defaults to "noopener" so a new-tab link can't access window.opener on the page it opened. This property overrides that default.

Gets or sets the size on the theme's font-size scale.

[Parameter]
public TextSize? Size { get; set; }

Property Value

TextSize?

Leave it unset to inherit the surrounding font size.

Gets or sets the name of the target frame or window for the navigation request.

[Parameter]
public string? Target { get; set; }

Property Value

string

Set this property to specify where the linked content will be displayed. Common values include "_blank" to open in a new window or tab, "_self" to open in the same frame, and "_parent" or "_top" for parent or top-level frames. If not set, the default behaviour depends on the browser and context.

Gets or sets the neutral colour of the link.

[Parameter]
public TextTone? Tone { get; set; }

Property Value

TextTone?

Ignored when Color is set. Use Inherit to keep the surrounding colour.

Gets or sets whether overflowing link text is truncated with an ellipsis.

[Parameter]
public bool Truncate { get; set; }

Property Value

bool

Gets or sets the weight on the theme's font-weight scale.

[Parameter]
public TextWeight? Weight { get; set; }

Property Value

TextWeight?

Leave it unset to inherit the surrounding font weight.

Methods

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder