Link
Overview
Links allow users to navigate to different sections or pages within the interface. Torq offers inline, stand alone and external links.
Live demo
Usage
Do
Use Links for navigation within application, in-page jumps, or to external sites.
Use Icons to indicate if the Link will take user’s to an external site.
Don't
Avoid using Links for actions that alter data, manipulate display, change states, or trigger specific actions; opt for Buttons instead.
Don’t use Links in titles. This ensures a consistent and intuitive user experience across the website without unintentionally redirecting users when interacting with page titles.
Minimise the use of Links, especially Inline Links, as an excess can clutter the page, potentially confusing users.
Variants
| Example | Variant | When to use |
|---|---|---|
Link | Stand-alone | Use a stand-alone link when it is not embedded within a sentence and is displayed on its own. Ensure the link text is clear, actionable, and communicates the purpose of the link. |
Link | Inline | Use an inline link when embedding it in a sentence. Inline links are underlined to ensure they are easily recognisable as interactive elements, including for users with colour blindness. Keep link text concise and relevant to the context of the surrounding content. |
Link | External | Use an external link when directing users to a different website or when opening a link in a new tab. Consider using an external link icon to make this behaviour clear to users. If a new tab is opened, ensure the target="_blank" attribute is used and the link clearly indicates the external nature of the destination, such as “Visit our partner site.” |
Content
Remember that Link content and placement should work for users navigating with screen readers. Screen readers pull only the Link text, they do not pull the surrounding content. The Link should tell the user where the Link will take them.
Keep text concise. Don’t link whole paragraphs or sentences within paragraphs.
Avoid using the same link text for two different URLs.
Don’t use the word ‘link' in your Links. Screen readers tell the user when they encounter a Link.
Don’t capitalise Links. Capital letters are harder to read for everyone, but especially people with reading disabilities.
Avoid generic phrases like “Learn more” or “Click here.” Instead, describe the destination or action, such as “View pricing details” or “Download the report.”
Sizes
There are six size variants for the Link component.
The Link size should match the type size of the text it is inline with. The standalone Link size should match the default body copy size of the page.
| Example | Size | Font-size (px) |
|---|---|---|
Link | Medium | 15 |
Link | xsmall | 11 |
Link | small | 13 |
Link | Large | 17 |
Link | Medium-relaxed | 17 |
Link | Large-relaxed | 20 |
Link | Xlarge-relaxed | 22 |
States and interactions
| Example | State | When to use |
|---|---|---|
Link | Enabled | The default state when the Link is not interacted with. |
Link | Hover | Visual changes when the user hovers over the Link. |
Link | Active | Visual changes when the user actively interacts with the Link (e.g. clicks). |
Link | Focused | The state when the Link receives keyboard focus. |
Link | Visited | Indicates that a user has already accessed the Link, as a helpful indicator. |
Link | Disabled | Non-interactive state, shows that it exists but is not available in that circumstance. |
Accessibility
The text should be meaningful when read out of context. This helps screen reader users who may navigate through Links on a page by reading the Link text alone.
Identify the target of each Link directly in the Link text to communicate context and set clear expectations about where it will go.
Ensure that users can navigate to the Link using the keyboard alone, and activate the Link using the Enter key. This helps users who are unable to use a mouse.
Keep text concise. Screen readers have a number of functions that allow users to skip to the next word, next sentence, next paragraph or next heading, but they have to read the entirety of a Link.
Indicate when a Link opens in a new window: Add an icon to the Link with the appropriate ALT attribute. If using an icon, make sure the icon appears after the Link text.