• Atom
  • CORE COMPONENT
  • Taxonomic name: A-LINK
  • Added on: v3.0.0 (15/09/17)
  • Updated on: v4.0.0 (20/07/18)

Links


Design and usage

All in-line links

Structure

  • All links and basic link icons built to work on light and dark accent colours.

Accessibility and screen readers

  • It must be understandable from the copy within the anchor tag where the link is going, even when removed from context.
  • When a link needs to be more descriptive of what / where it is going, but there is a requirement to show simplified text, the additional text can be hidden visually - see developer notes for how to achieve this.
  • PROHIBITED: Anchors must not open in a new window, eg. target="_blank", unless it would disrupt a user's journey (for example, when within a large form). Read more about opening links in new windows.

Placement

  • To be used in-line within blocks of text
  • PROHIBITED: Not to be used outside of text blocks - use buttons instead

Links with icons

Structure

  • The icon always follows the text, never before it
  • Text is always bold weight, underlined
  • Padding between text and icon is 5px
  • First letter case is dependent on it's location within a sentence eg. if the link follows a fullstop it's first letter is capitalised; otherwise, it is lower-case
  • PROHIBITED: There are some buttons with icons that aren't available as in-line links with icons
  • PROHIBITED: Changing font weights

Examples

Interactive example

Code example

<a href="...">...</a>
<a class="a-link-icon [ Modifier ]" href="..."><span class="a-link-icon__inner">...</span></a>

Development and test

Notes for developers

Visible labels and accessible names

When a button needs to be more descriptive of what it is or where it is going, but there is a requirement to show simplified text, then an extra span with the class u-hidden--visually is required within the a tag to hold the hidden text required to make the accessible name for the label meaningful to screen readers. The visible label should always come first, with the hidden text following on to extend this by adding meaning and context, for example:

<a href="...">Find out more<span class="u-hidden--visually"> about car insurance</span></a>

This also helps to ensure that all buttons and links are unique through the page, rather than having multiple instances of links simply saying "Read more".

Links to external websites

If a link is taking the user to an external website, ensure that it is clear that it will do so by making the title attribute descriptive of what it will do and where it will go, for example:

<a href="https://www.google.com" title="External site - www.google.com" rel="external">Google</a>

Telephone numbers

By default, iOS, Android and some other devices will interpret text as a phone number. When the user taps / clicks on these numbers, the device's call application will launch; in order for as many devices as possible to correctly recognise a phone number, the following formats should be used within the UK:

  • 555 555 5555
  • 55555 555 555

Read more about national conventions for writing telephone numbers.

Some devices may turn the detected telephone number into a link, so the number may change to the relevant link style, this can cause problems where large numbers are detected incorrectly as a telephone number. We recommend that automatic telephone number detection is disabled by using the following meta tag in the head of your pages and any telephone numbers are wrapped in a link/anchor tag:

<meta name="format-detection" content="telephone=no" />

When adding in a link to a telephone number ensure that the format of the number only contains "0-9", "-" and "+", no spaces or other special characters, for example:

<a href="tel:+1-555-555-5555">1-555-555-5555</a>

Notes for testers

  • Ensure that links can be accessed via the mouse as well as via tabbing using the keyboard.
  • Use a screen reader to confirm that the links are understandable as to where they will be going when listed out of context of the page.
  • Ensure that when hovering over a link the style changes noticeably.
  • Ensure that when a link has focus the style changes noticeably.
  • Ensure that text within links is descriptive of what or where the link is going; additional descriptive text can be hidden visually from the user to help make the link understandable, especially if there area number of links such as "Find out more" on the page which go to different locations.
  • Ensure that all links are device agnostic - they must not specify how a user should be interacting with a link, eg. click.
  • Ensure that any instructions are fully device agnostic - they must not refer to how the user should interact with an element, eg. click, or when an element may be relocated (unless it always directly follows or precedes the instruction) no matter what device is being used.

Classes overview

The following table gives you a quick overview of the CSS classes that can be applied.

Class Outcome Required Applied to Comments
.a-link-icon Base style for all links with an icon Yes a Only required when the link is to have an icon
.a-link-icon--attachment Positions attachment icon to the right of the link   .a-link-icon
.a-link-icon--auto-renewal Positions auto-renewal icon to the right of the link   .a-link-icon
.a-link-icon--bookmark Positions bookmark icon to the right of the link   .a-link-icon
.a-link-icon--calculator Positions calculator icon to the right of the link   .a-link-icon
.a-link-icon--call Positions call icon to the right of the link   .a-link-icon
.a-link-icon--claim Positions claim icon to the right of the link   .a-link-icon
.a-link-icon--document Positions document icon to the right of the link   .a-link-icon
.a-link-icon--download Positions download icon to the right of the link   .a-link-icon
.a-link-icon--edit Positions edit icon to the right of the link   .a-link-icon
.a-link-icon--external Positions external link icon to the right of the link   .a-link-icon
.a-link-icon--geo-location Positions geo-location icon to the right of the link   .a-link-icon
.a-link-icon--information Positions information icon to the right of the link   .a-link-icon
.a-link-icon--links Positions links icon to the right of the link   .a-link-icon
.a-link-icon--location Positions location icon to the right of the link   .a-link-icon
.a-link-icon--medical-professional Positions medical-professional icon to the right of the link   .a-link-icon
.a-link-icon--message Positions message icon to the right of the link   .a-link-icon
.a-link-icon--new-window Positions new-window icon to the right of the link   .a-link-icon
.a-link-icon--places Positions places icon to the right of the link   .a-link-icon
.a-link-icon--profile Positions profile icon to the right of the link   .a-link-icon
.a-link-icon--rss Positions RSS icon to the right of the link   .a-link-icon
.a-link-icon--search Positions search icon to the right of the link   .a-link-icon
.a-link-icon--secure Positions secure icon to the right of the link   .a-link-icon
.a-link-icon--share Positions share icon to the right of the link   .a-link-icon
.a-link-icon--upload Positions upload icon to the right of the link   .a-link-icon

Keyboard operations

TAB

Tabbing to an anchor should make the anchor clearly visually different so that the focus point on the page is obvious to the user.

SPACE or ENTER

With focus on an anchor, pressing SPACE or ENTER will open the link. If the link is internal to the page it will scroll the page otherwise it will load the new page.

Component releases

  • Added on: v3.0.0 (15/09/17)
  • Updated on: v4.0.0 (20/07/18)

Latest update:

  • The link icons that were deprecated in v3.3.0 have now been removed/replaced. Temporary "after" classes have now been made the default style overriding the old class name.
  • Specialism icon set has been removed as part of the removal of the module it was associated with from Framework.

Full version history

A full history of changes and enhancements detailing all minor and major updates to the component.

View full version history

Want something new in Framework, or to chat about an issue you're having with it?

Contact the team