Design System

Design System

Link

Actions

Open in Storybook: Link (opens in a new tab)

On this page

Overview

The a href for a control that takes the user somewhere: another page, a section of this page, a file or an external site. It is always a native a with an href. Without one it is not a link: no role, no focus, no Enter. If it does something on the page instead, it is a button.

They are always underlined, because colour alone never marks a link.

Anatomy

  1. Link

    a href

    The one element. It holds the role, the name and the focus, and it is a link only with an href. An external link also has target="_blank", and words after the visible ones that only a screen reader gets.

  2. Label

    text

    The visible words are the start of the accessible name, and say where the link goes. Underlined in every state.

  3. Icon

    svg aria-hidden="true"

    Decorative, 20px, after the words, in their colour: an arrow, the external mark or a download tray. A link in a sentence has none.

Usage

Use cases

The seven of the design, each the real link, and each works.

  • Distinguishable

    A link in text must not rely on colour. It is underlined in body text, in every state.

    text-decoration: underline

  • Cards with “Read more”

    Make the card title the link, or add hidden context after the visible words.

    a href, span visually hidden

  • New tab and external

    Avoid new tabs. If you must: the icon, and “(opens in new tab)” in the name.

    target="_blank" rel="noopener", svg aria-hidden="true"

  • Downloads

    Say what and how big: the file’s name, its type and its size in the visible words.

    a href download

  • Looks like a button

    A link can look like a button. A link without an href cannot be a link.

    a href, class="bt bt--primary"

Props

Props
PropDoesDefault
hrefWhere it goes. Required: an a without it is not a link.required
childrenThe visible words, and the start of the accessible name. They say where the link goes.required
kindinline, standalone, external or download.inline
contextWords only a screen reader gets, after the visible ones: “about descaling” after “Read more”.—
newTabLabelWhat an external link says after its words, in the language of the page.(opens in new tab)
target, rel, download, onClick, ref, any native attributeAs on an a. external sets target="_blank" and rel="noopener", and download sets download, or the name of the file if you pass one.—

Example

external adds the icon, target="_blank" and “(opens in new tab)” to the name. context adds words after the visible ones, and the name still starts with what is seen (2.5.3).

<p>
  Before you start, read the <Link href="/descaling">descaling guide</Link>.
</p>

<Link kind="standalone" href="/machines">See all machines</Link>

<Link kind="external" href="https://example.org/a11y">
  Accessibility statement
</Link>

<Link kind="download" href="/report-2026.pdf">
  Annual report (PDF, 2 MB)
</Link>

<Link href="/descaling" context="about descaling">Read more</Link>

Specs

Measurements

Measurements
PartPropertyValue
Wordscolor, fontaccent, the size of the text around. 400 in a sentence, 700 alone
Underlinetext-decoration1px, text-underline-offset 3px. 3px on hover and on focus
Link in a sentencepadding0.125rem above and below, none beside: the text around it does not move
Link alonepadding0.125rem 0.25rem (2px 4px)
Iconsize, gap20px after the words, 0.375rem (6px) between, in the colour of the words
Cornerborder-radius2px; radius (8px) on focus
Focus ringoutline, box-shadowthe site’s: 4px focus-ring-primary 3px outside, and a halo of focus-ring-soft 3px and focus-ring-primary 7px
A link that wrapsbox-decoration-breakclone: the fill and the underline on every line

States

States
StateWordsUnderlineFill
Defaultaccent1pxnone
Hoveraccent-text3pxnone
Focusink3pxmarker, and the ring of the site
Visitedaccent-text1pxnone

Hover thickens the underline: a colour change alone would not be enough. Visited is optional, darker, and never the only way to tell links apart. A browser lets CSS change only the colour of a visited link.

Types

Types
TypeWeightIconFor
Inline400nonea link in a sentence
Standalone700an arrowa link on its own: “See all machines”
External700the external marka new tab or another site. target="_blank", and “(opens in new tab)” in the name
Download700a download traya file that has a place. The name, the type and the size in the visible words, and download

Tokens

Component tokens

Component tokens
PartPropertyTokenValue
Wordscoloraccent#5e548e
Words, hover and visitedcoloraccent-text#3d3459
Words, focuscolorink#16161a
Fill, focusbackgroundmarker#ffe600
Corner, focusborder-radiusradius8px
Ringoutlinefocus-ring-primary, focus-ring-width#0066ff, 4px
Halobox-shadowfocus-ring-soft, focus-ring-primary#a5c8ff 3px, #0066ff 7px

Guidelines

Button or link

Button or link
ElementUse it whenExamples
a hrefit goes somewhereanother page or route · a section of this page (#id) · a file download, when the file already has a URL · an external site · open in a new tab
buttonit does something on the pagesee the Button page

Style follows the design; the element follows the behaviour. A “Shop now” that navigates is an a href styled as a button.

Which link

Which link
LinkUse it for
Inlinea link in a sentence. Underlined in every state
Standalonea link on its own, with an arrow
Externala new tab or another site, with its icon and its words
Downloada file that has a place
Navigation and footerthe site’s nav and muted links can drop the underline, because their position already says “this is a link”, but they still need a visible hover and focus. They have no design on the Figma page and are not built here

Content

Content
PartFormatExample
Link textwhere it goes: readable alone, short, with the key words first. Not “click here”, a repeated “Read more” or a raw URL. The same text is the same destination (3.2.4)See our warranty terms.
Read moremake the card title the link; or keep the words and add hidden context after them, so the name still starts with what is seenRead more, and “about descaling”
Externalthe icon, hidden from assistive technology, and “(opens in new tab)” in the name. The same for leaving the siteAccessibility statement (opens in new tab)
Downloadthe name, the type and the size in the visible wordsAnnual report (PDF, 2 MB)
Icondecorative: aria-hidden="true"—

Behavior

Behavior
EventResult
Enter or clickfollows the href
Hoverthe underline grows to 3px and the words darken
Focusa yellow fill, ink words, a 3px underline and the ring of the site. The link is raised above its neighbours, so the ring is not clipped
Externalopens a new tab, and says so in its name
Downloadsaves the file, when it has a place and download
Wrapsthe underline and the fill are on every line

Link or button for downloads

download belongs on a link only when there is a file to point to: a URL in the app or on the server. If the file has to be generated, converted or zipped first, there is nowhere to go yet: it is an action, so a button builds the file and then saves it.

Link or button for downloads
The file…ElementWhy
already exists at a URL (/report-2026.pdf, a stored asset)a href="/report-2026.pdf" downloadIt goes somewhere: a link. Copy, open in new tab and the links list all work.
must be generated, converted or zipped first (export orders to CSV, convert to PDF, zip photos)button type="button" “Export orders (CSV)”It does something: build the file, then save it. No location exists until the action runs.

Skip link

The first focusable element on every page, visually hidden until it gets focus, and then shown in the Focus state above. It points to main id="main", which takes focus with tabindex="-1" (2.4.1). It is an entry of its own: Skip to Main Content.

Fake links

Fake links
MarkupWhy not
a onclickNo href: no role, no focus, no Enter
a href="#" onclickA link that goes nowhere, to run a script. Announced as a link, Space scrolls the page, the URL gets a #
a href="javascript:void(0)"The same. If it does something, it is a button

Accessibility

Keyboard

Keyboard
KeyActionNative
Tab, Shift+Tabmoves between links in DOM order. An a with no href is skippedyes
Enterfollows the linkyes
Spacedoes nothing: it scrolls the page. One more reason not to make a button of a linkyes
Context menucopy the address, open in a new tab: only on a real a hrefyes

Roles and properties

Roles and properties
PropertyExposedNote
rolelinkimplicit, and only with an href
namethe visible words, then the words of context, then “(opens in new tab)”starts with the visible words (2.5.3)
hrefthe destinationrequired
target="_blank", rel="noopener"a new taban external link only
downloadthe file is saveda download link only
iconnothingaria-hidden="true", focusable="false"

Names

Chromium’s accessible name for each, from the tests. The list of links of a screen reader (VoiceOver rotor, NVDA Insert+F7) reads these, out of context, which is why each must stand alone. None was run in a screen reader.

Names
MarkupName
Link in a sentencedescaling guide
kind="standalone"See all machines
kind="external"Accessibility statement (opens in new tab)
kind="download"Annual report (PDF, 2 MB)
context="about descaling"Read more about descaling

Measured behavior

Chromium 148.0.7778.96, from the tests.

Measured behavior
ObservationConsequence
Space does not activate a linka link is never a button: what only a button does is not a link
An a with no href has no role and Tab goes past ithref is required by the component
Hovered and focused at once, the link keeps its yellow fill:focus-visible comes after :hover
A focused link is raised: position: relative, z-index: 10the global rule of the site does it, and the ring is not clipped by a neighbour
A link that wraps has more than one box, and box-decoration-break: clone paints the underline in eacha long link keeps its cue on every line
Lilac on white is 6.7 to 1, not the 7.1 to 1 that the Figma page saysthe page says 6.7

Support

Support
BrowserChecked
Chromium 148yes, in the tests and the stories
WebKit, Firefoxnot run

WCAG criteria

WCAG criteria
CriterionLevelRequirement here
1.4.1 Use of ColorAunderlined in every state. Lilac on ink text is 2.7 to 1, so the underline is the cue and the colour a bonus
1.4.3 Contrast (Minimum)AAlilac on white is 6.7 to 1, lilac-deep 11.5 to 1, ink on the yellow fill 14.2 to 1
1.4.4 Resize TextAAsizes are in rem and the link grows with the text
1.4.11 Non-text ContrastAAthe ring is 4.8 to 1 against the page
2.1.1 KeyboardAa native a href: Tab and Enter
2.4.1 Bypass BlocksAthe skip link, the first focusable element of every page
2.4.4 Link Purpose (In Context)Aeach link makes sense on its own, or at least with its sentence
2.4.7 Focus VisibleAAthe fill, the underline and the ring of the site
2.4.9 Link Purpose (Link Only)AAAthe visible words say where it goes; hidden context finishes them
2.5.3 Label in NameAthe name starts with the visible words
2.5.8 Target Size (Minimum)AAa link alone is 24px high or more. A link in a sentence is exempt
3.2.4 Consistent IdentificationAAthe same text is the same destination
3.2.5 Change on RequestAAAa new tab is said in the name, before it opens
4.1.2 Name, Role, ValueAa native a with an href
Techniques—G183 (3 to 1 and a non-colour cue), G201 (warn about new windows), H30, C7 (hidden link context)

Related

This section is still in progress.

References

Read the post: Link or Button (opens in a new tab)