tuix-link

A styled anchor that degrades to plain text when disabled.

Loading the components…

Variants

primary is the brand colour; secondary is white, for dark surfaces and photos. Both underline on hover. The element adds no focus style of its own, so a focused link shows the browser's own outline.

Loading the components…

Disabled

A disabled link is not an anchor at all: the component renders a <div>, so there is nothing to focus, hover or click.

Loading the components…

The same happens without an href, which is useful for a link whose target is not loaded yet.

Targets

target defaults to _blank.

<tuix-link href="/invoices" target="_self">Invoices</tuix-link>

Pass target="_self" for in-app navigation. Client-side routing needs the router's own link component, because this element always does a full navigation.

API

Properties

PropertyAttributeTypeDefaultDescription
hrefhrefstringNoneTarget URL. Without it the link renders as text
targettargetLinkTarget_blank_blank, _self, _parent or _top
variantvariantMainVariantprimaryprimary is the brand colour, secondary is white
disableddisabledbooleanfalseRenders as inert text, not an anchor
darkdarkbooleanfalseDark palette

Slots

SlotContent
defaultThe link text, styled with TextSize.Link

The element fires no custom events; a click on the anchor behaves natively.

Notes

The link exposes its colour as the --t-link-text-color custom property, which a nested tuix-text picks up instead of its own color. That is what keeps a link inside a paragraph on the link colour:

<tuix-text size="body1"> See the <tuix-link href="/terms">terms</tuix-link> for details. </tuix-text>

On this page