Navigation
Back link
A link to the previous page of a task, for when the browser's back button might not take people there.
When to use
- On the question pages of a form or service, where going back keeps people's answers.
- After a page that a form sent people to, where the browser's back button would send the form again.
When not to use
- On information pages. Use breadcrumbs, which show where the page sits.
- With breadcrumbs on the same page: use one or the other.
How to use
- Put it at the top of the main content, before the heading.
- Link to the previous page itself, with its answers, not to the start of the task.
- Keep the word "Back". Only change it when "Back" would be unclear, such as "Back to your applications".
Accessibility
What GGDS does
- The arrow is drawn with CSS and is not read out; the link says "Back".
- The link is at least 44px tall.
What you need to do
- Make it a real link with an
href, not a script that callshistory.back(), so it works without JavaScript and can be opened in a new tab.
Example: Back link
<a class="ggds-back-link" href="/services/licence/apply/contact/">Back</a><a className="ggds-back-link" href="/services/licence/apply/contact/">Back</a>Use it
- Stylesheet
ggds.cssincludes it. To load only the parts you use:core.css, thencomponents/navigation.css(0.9 KB with gzip, minified), which also holds breadcrumbs, pagination and tab links.- JavaScript
- None needed.
HTML
Copy the HTML under each example above. It works in any website.
Astro
With @ggds/astro:
import BackLink from '@ggds/astro/BackLink.astro';
<BackLink href="/services/licence/apply/contact/" />React and Next.js
No React component: switch the HTML under an example to JSX (React) and copy it.
Django
With ggds-django ({% load ggds %}):
{% ggds_back_link "/services/licence/apply/contact/" %}Classes and states
| Class | What it does |
|---|---|
.ggds-back-link | A link to the previous page of a task, with an arrow drawn before it. |
Accessibility tests
Automated, on every change
These run each time GGDS changes. A change that fails one is not accepted.
- WCAG 2.2 A and AA rules (axe), at desktop and phone widths, on every example
- No sideways scrolling on a 320px screen, also with a wide font, on every example
- Every approved colour pair meets its contrast minimum, for every institution theme
- No inline scripts or styles, so it runs under a strict Content Security Policy
- Behaviour test: “no horizontal scrolling at 320px”
- Behaviour test: “no horizontal scrolling at 320px with a wide font”
By people, with assistive technology
Automated tests find only some of the barriers people meet. These checks are still to be done.
| Check | Result | Notes |
|---|---|---|
| Keyboard only | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| NVDA screen reader with Firefox or Chrome (Windows) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| JAWS screen reader with Chrome (Windows) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| VoiceOver screen reader with Safari (iPhone) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| TalkBack screen reader with Chrome (Android) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Zoom to 400%, and increased text spacing | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Windows contrast themes (forced colours) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Voice control (Voice Access or Dragon) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
Changes
| Version | Change |
|---|---|
| 0.4.0 | New components: back link, side navigation, contents list ("On this page"), language switcher, phase banner, cookie banner and character count, in HTML, Django, React and (except the character count) Astro. All are alpha: tested automatically, not yet on a live website. The cookie banner needs no JavaScript: its buttons send a form, and both choices look the same. |
| 0.1.0 | Added. |
Related components
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.