Link
Actions
Open in Storybook: Link (opens in a new tab)
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
- Link
a hrefThe one element. It holds the role, the name and the focus, and it is a link only with an
href. An external link also hastarget="_blank", and words after the visible ones that only a screen reader gets. - Label
text
The visible words are the start of the accessible name, and say where the link goes. Underlined in every state.
- 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.
Types
The four of the design: a link in a sentence, and three that stand alone with an icon. Follow any of them: it stays on this page.
Before you start, read the descaling guide and check the water hardness of your area.
See all machinesAccessibility statement (opens in new tab)Annual report (PDF, 2 MB)Follow a link: it stays on this page.
a href,kindDistinguishable
A link in text must not rely on colour. It is underlined in body text, in every state.
Don’t
Before you start, read the descaling guide and check the water hardness of your area.
Colour is the only cue. Lilac on ink text is under 3 to 1, so a person with low vision or colour blindness cannot find the link (1.4.1).
Do
Before you start, read the descaling guide and check the water hardness of your area.
Underlined in body text, in every state. The underline is the cue; the colour is a bonus.
Follow a link: it stays on this page.
text-decoration: underlineLink text says where it goes
Each link makes sense on its own, or at least with its sentence. The same text is the same destination.
Don’t
- To see our warranty, click here.
- Read more · Read more · Read more
- https://example.com/support/machines/descaling?ref=nav
“Click here”, a repeated “Read more” and a raw URL. A list of the links of the page reads “click here, read more, read more, read more, h t t p s…”.
Do
The destination is in the link text. Readable alone, short, with the key words first.
Follow a link: it stays on this page.
The visible words are the name
Cards with “Read more”
Make the card title the link, or add hidden context after the visible words.
Do
How to descale your machine
Every month, or every 200 cups.
The best fix: the title is the link. It is unique and descriptive, and “Read more” goes away.
Do
How to descale your machine
Every month, or every 200 cups.
Read more about descalingOr hidden context: the visible words are “Read more”, the name is “Read more about descaling”. It still starts with what is seen, so voice control works (2.5.3).
Follow a link: it stays on this page.
a href,spanvisually hiddenNew tab and external
Avoid new tabs. If you must: the icon, and “(opens in new tab)” in the name.
Don’t
Opens a new tab with no warning. A screen reader user and a magnifier user lose the Back button and their place (G201, 3.2.5).
Do
Avoid new tabs. If you must: the external icon, hidden from assistive technology, and “(opens in new tab)” in the name. The same for leaving the site.
Follow a link: it stays on this page.
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.
Don’t
Download what? In which format? On a slow connection, how long will it take?
Do
The file’s name, its type and its size in the visible words.
downloadonly when the file already has a place that thehrefcan point to.Follow a link: it stays on this page.
a href download
Props
| Prop | Does | Default |
|---|---|---|
href | Where it goes. Required: an a without it is not a link. | required |
children | The visible words, and the start of the accessible name. They say where the link goes. | required |
kind | inline, standalone, external or download. | inline |
context | Words only a screen reader gets, after the visible ones: “about descaling” after “Read more”. | — |
newTabLabel | What an external link says after its words, in the language of the page. | (opens in new tab) |
target, rel, download, onClick, ref, any native attribute | As 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
| Part | Property | Value |
|---|---|---|
| Words | color, font | accent, the size of the text around. 400 in a sentence, 700 alone |
| Underline | text-decoration | 1px, text-underline-offset 3px. 3px on hover and on focus |
| Link in a sentence | padding | 0.125rem above and below, none beside: the text around it does not move |
| Link alone | padding | 0.125rem 0.25rem (2px 4px) |
| Icon | size, gap | 20px after the words, 0.375rem (6px) between, in the colour of the words |
| Corner | border-radius | 2px; radius (8px) on focus |
| Focus ring | outline, box-shadow | the site’s: 4px focus-ring-primary 3px outside, and a halo of focus-ring-soft 3px and focus-ring-primary 7px |
| A link that wraps | box-decoration-break | clone: the fill and the underline on every line |
States
| State | Words | Underline | Fill |
|---|---|---|---|
| Default | accent | 1px | none |
| Hover | accent-text | 3px | none |
| Focus | ink | 3px | marker, and the ring of the site |
| Visited | accent-text | 1px | none |
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
| Type | Weight | Icon | For |
|---|---|---|---|
| Inline | 400 | none | a link in a sentence |
| Standalone | 700 | an arrow | a link on its own: “See all machines” |
| External | 700 | the external mark | a new tab or another site. target="_blank", and “(opens in new tab)” in the name |
| Download | 700 | a download tray | a file that has a place. The name, the type and the size in the visible words, and download |
Tokens
Component tokens
| Part | Property | Token | Value |
|---|---|---|---|
| Words | color | accent | #5e548e |
| Words, hover and visited | color | accent-text | #3d3459 |
| Words, focus | color | ink | #16161a |
| Fill, focus | background | marker | #ffe600 |
| Corner, focus | border-radius | radius | 8px |
| Ring | outline | focus-ring-primary, focus-ring-width | #0066ff, 4px |
| Halo | box-shadow | focus-ring-soft, focus-ring-primary | #a5c8ff 3px, #0066ff 7px |
Guidelines
Button or link
| Element | Use it when | Examples |
|---|---|---|
a href | it goes somewhere | another 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 |
button | it does something on the page | see 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
| Link | Use it for |
|---|---|
| Inline | a link in a sentence. Underlined in every state |
| Standalone | a link on its own, with an arrow |
| External | a new tab or another site, with its icon and its words |
| Download | a file that has a place |
| Navigation and footer | the 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
| Part | Format | Example |
|---|---|---|
| Link text | where 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 more | make the card title the link; or keep the words and add hidden context after them, so the name still starts with what is seen | Read more, and “about descaling” |
| External | the icon, hidden from assistive technology, and “(opens in new tab)” in the name. The same for leaving the site | Accessibility statement (opens in new tab) |
| Download | the name, the type and the size in the visible words | Annual report (PDF, 2 MB) |
| Icon | decorative: aria-hidden="true" | — |
Behavior
| Event | Result |
|---|---|
| Enter or click | follows the href |
| Hover | the underline grows to 3px and the words darken |
| Focus | a 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 |
| External | opens a new tab, and says so in its name |
| Download | saves the file, when it has a place and download |
| Wraps | the 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.
| The file… | Element | Why |
|---|---|---|
already exists at a URL (/report-2026.pdf, a stored asset) | a href="/report-2026.pdf" download | It 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
| Markup | Why not |
|---|---|
a onclick | No href: no role, no focus, no Enter |
a href="#" onclick | A 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
| Key | Action | Native |
|---|---|---|
| Tab, Shift+Tab | moves between links in DOM order. An a with no href is skipped | yes |
| Enter | follows the link | yes |
| Space | does nothing: it scrolls the page. One more reason not to make a button of a link | yes |
| Context menu | copy the address, open in a new tab: only on a real a href | yes |
Roles and properties
| Property | Exposed | Note |
|---|---|---|
| role | link | implicit, and only with an href |
| name | the visible words, then the words of context, then “(opens in new tab)” | starts with the visible words (2.5.3) |
href | the destination | required |
target="_blank", rel="noopener" | a new tab | an external link only |
download | the file is saved | a download link only |
| icon | nothing | aria-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.
| Markup | Name |
|---|---|
Link in a sentence | descaling 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.
| Observation | Consequence |
|---|---|
| Space does not activate a link | a 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 it | href 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: 10 | the 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 each | a 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 says | the page says 6.7 |
Support
| Browser | Checked |
|---|---|
| Chromium 148 | yes, in the tests and the stories |
| WebKit, Firefox | not run |
WCAG criteria
| Criterion | Level | Requirement here |
|---|---|---|
| 1.4.1 Use of Color | A | underlined 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) | AA | lilac 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 Text | AA | sizes are in rem and the link grows with the text |
| 1.4.11 Non-text Contrast | AA | the ring is 4.8 to 1 against the page |
| 2.1.1 Keyboard | A | a native a href: Tab and Enter |
| 2.4.1 Bypass Blocks | A | the skip link, the first focusable element of every page |
| 2.4.4 Link Purpose (In Context) | A | each link makes sense on its own, or at least with its sentence |
| 2.4.7 Focus Visible | AA | the fill, the underline and the ring of the site |
| 2.4.9 Link Purpose (Link Only) | AAA | the visible words say where it goes; hidden context finishes them |
| 2.5.3 Label in Name | A | the name starts with the visible words |
| 2.5.8 Target Size (Minimum) | AA | a link alone is 24px high or more. A link in a sentence is exempt |
| 3.2.4 Consistent Identification | AA | the same text is the same destination |
| 3.2.5 Change on Request | AAA | a new tab is said in the name, before it opens |
| 4.1.2 Name, Role, Value | A | a 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.