StartFoundationsComponentsContent

Link

A link takes the reader to another place. It matches the size and weight of the text around it and adds the link color and an underline.

Stable Figma
OverviewUsageAPIAccessibility

Read our privacy policy before you sign up.

<p>Read our <tk-link href="/privacy">privacy policy</tk-link> before you sign up.</p>

Anatomy

Part What it is
tk-link the element; one Tab stop when it has href
default slot the link text, required; it is the accessible name
link part the native <a> inside

A link has no size of its own. It takes its font from its surroundings, so it's Body Medium in a paragraph and larger in a heading. To change its size, style the text around it.

Variants

Underline

See the setup guide.

Pricing
<p>See the <tk-link href="/guide">setup guide</tk-link>.</p>
<tk-link href="/pricing" underline="hover">Pricing</tk-link>
  • always (default): underlined at rest, so the link doesn't rely on color. Use it for every link in running text.
  • hover: the underline shows on hover and keyboard focus. Use it only where it's already clear that it's a link, such as a nav row. Never in running text.

Color

Questions? Visit the help center.

<p>Questions? <tk-link href="/help" color="inherit">Visit the help center</tk-link>.</p>
  • accent (default): the link color, distinct from body text.
  • inherit: the color of the surrounding text; keep the underline.
  • inverse: for a link on an inverse (dark) surface. Set the surface to the dark theme so the focus ring matches.

Don't combine color="inherit" with underline="hover": the link looks exactly like the text around it. The component warns in the console.

Quiet

<nav aria-label="Account">
  <tk-link href="/profile" treatment="quiet">Profile</tk-link>
  <tk-link href="/billing" treatment="quiet">Billing</tk-link>
</nav>

treatment="quiet" is a muted link with no underline at rest. On hover and focus it gets darker and shows the underline. It replaces color and underline, which then have no effect. Use it only in navigation rows and trails, never in running text.

States

Reports Current page
<tk-link href="/reports">Reports</tk-link>
<tk-link aria-current="page">Current page</tk-link>

Hover, press, and focus need no props. Hover shows the underline and, for accent, a darker color. Keyboard focus shows a ring.

  • No href: the link can't be focused or followed. There is no disabled; leave out href instead.
  • aria-current="page": marks the link to the page the reader is on. The component passes it to the inner <a>.
  • Visited links look the same as unvisited ones.
Annual report (opens in a new tab)
<tk-link href="https://example.com/report" target="_blank" external>Annual report (opens in a new tab)</tk-link>
  • target="_blank" opens a new tab and adds rel="noopener noreferrer" for you, together with any rel you set.
  • external adds a trailing external-link icon. It scales and colors with the text and is hidden from screen readers.
  • Say "opens in a new tab" in the text when that matters; the icon is silent.