Navigation - Back link

Use back links to help users go back to the previous page in a multi-page transaction

Open this default back link example in new window
Copy default back link code
<div class="hs2-back-link">
  <a class="hs2-back-link__link" href="#">
    <svg class="hs2-icon hs2-icon__chevron-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true" height="24" width="24">
      <path d="M6.69995 6.82499L8.59995 8.69999L6.62495 10.675L21.325 10.675L21.325 13.325L6.62495 13.325L8.59995 15.3L6.69995 17.175L1.54995 12L6.69995 6.82499Z" />
    </svg>
    Go back</a>
</div>
Close default back link code
Nunjucks macro options

Use options to customise the appearance, content and behaviour of a component when using a macro, for example, changing the text.

Some options are required for the macro to work; these are marked as "Required" in the option description.

If you're using Nunjucks macros in production with "html" options, or ones ending with "html", you must sanitise the HTML to protect against cross-site scripting exploits.

Nunjucks arguments for default back link
Name Type Required Description
Name text Type string Required false Description Text to use within the back link component. If `html` is provided, the `text` argument will be ignored. Defaults to "Back".
Name html Type string Required false Description HTML to use within the back link component. If `html` is provided, the `text` argument will be ignored. Defaults to "Back".
Name href Type string Required true Description The value of the link href attribute.
Name classes Type string Required false Description Classes to add to the container.
Name attributes Type object Required false Description HTML attributes (for example data attributes) to add to the anchor tag.
Copy default back link code
{% from 'back-link/macro.njk' import backLink %}

{{ backLink({
  "href": "#",
  "text": "Go back"
}) }}
Close default back link code

When to use a back link

We only use back links on transactional services or multi-page forms.

The GOV.UK Design System recommends including a back link on question pages. Read more about question pages on GOV.UK.

You can include a back link on other pages in a multi-page transaction, if it makes sense to do so.

When not to use a back link

Do not use a back link on a content page.

Do not use a back link with breadcrumbs.

How to use back links

Make sure the text used in the link describes the action, for example "Go back". Carry out research with users to find the words that help them the most.

The link should take users back to the page they were on in the state they last saw it.

Consider where you put the back link. Do not put it close to other links or buttons where it might distract users from what they need to do.

The GOV.UK Design System says that you should put back links at the top of a page.

Accessibility

When you're considering where to put back link on a page, think about people who use a screen reader.

Also, make sure the text you use describes the action. Do not rely on "Go back". It might not reflect what users expect.