Links

A destination is a link and an action is a button. Every link here is a real <a href>: the browser navigates, so middle-click, ⌘- or Ctrl-click, a new tab, Copy link and Enter all work. Nothing navigates from a click handler.

Links within a reading list

Underlined text links and whole-row links keep their native navigation semantics.

One destination, two treatments

A quiet text link beside a stronger link button.

.ds-link (from controls.css) is a link in running text: the text’s own ink, underlined by a hairline 2px below the letters. The line turns to the full ink under the pointer, a visited link is drawn in the muted ink, and keyboard focus shows the shared focus ring. Its words keep their sentence case.

Browse the icons
<a class="ds-link" href="/icons/">Browse the icons</a>
TokenDefaultWhat it sets
--ds-link-colorThe text’s colourThe link’s ink.
--ds-link-visited-color--ds-text-color-mutedThe ink of a visited link.
--ds-link-line-colorThe ink at 40%The underline at rest.
--ds-link-hover-line-colorThe inkThe underline under the pointer.

Add ds-link--plain for a text link without an underline, including on hover. Use it in clearly labelled navigation or related-component lists. It keeps the normal link behaviour, visited colour and visible keyboard focus.

Example uses Footer · Prose · Table

<a class="ds-link ds-link--plain" href="/4-page/footer/">Footer</a>

Give ds-button an href and its face becomes a link (<a part="control">) drawn exactly as the button, in every variant and state:

<ds-button secondary href="/icons/">Icons</ds-button>
<ds-button href="https://example.com/" blank>Example</ds-button>

React products use ButtonLink from the button adapter; the anchor is the light-DOM control, and refs and handlers reach it:

import { ButtonLink } from './design/react/button';
<ButtonLink secondary href="/icons/">Icons</ButtonLink>

blank on ds-button is target="_blank". A new tab gets rel="noopener noreferrer" unless rel says otherwise, on the element and in ButtonLink alike. target and rel are passed to the link as written.

A disabled link has no href (and no target), so it cannot navigate, and it is left out of the tab order. It stays a link to assistive technology with role="link" and aria-disabled="true", dimmed like a disabled button. For a.ds-button and .ds-link, remove the href yourself and set aria-disabled="true".

See Button for a working preview and Icon for the library.