You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -79,7 +80,7 @@ The heading button includes all of these areas:
79
80
80
81
For users of screen readers, all the text in the button will be read as a single statement (separated by commas to allow for slight pauses). There’s also some visually hidden content in the heading text to help announce the call-to-action as 'show this section' or 'hide this section'.
Copy file name to clipboardExpand all lines: src/components/back-link/index.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
title: Back link
3
3
description: Use the back link component to help users go back to the previous page in a multi-page transaction
4
4
section: Components
5
+
item: back-link
5
6
aliases: return link, back button
6
7
backlogIssueId: 32
7
8
layout: layout-pane.njk
@@ -37,7 +38,7 @@ See the full list of [components and patterns affected by WCAG 2.2](/accessibili
37
38
38
39
Although browsers have a back button, some sites break when you use it - so many users avoid it, instead of losing their progress in a service. Also, not all users are aware of the back button.
@@ -76,7 +77,7 @@ Where possible, ensure the back link works even when JavaScript is not available
76
77
77
78
There are 2 ways to use the back link component. You can use HTML or, if you are using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk), you can use the Nunjucks macro.
Using the default link text ('Back') is ideal for services with a simple journey. For example, [applying for a National Insurance number](https://www.gov.uk/apply-national-insurance-number). Users will only ever go back to the previous page in the service.
82
83
@@ -88,4 +89,4 @@ Use the `govuk-back-link--inverse` modifier class to show a white link on a dark
88
89
89
90
Make sure all users can see the back link – the background colour [must have a contrast ratio of at least 4.5:1](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html) with white.
@@ -62,20 +63,20 @@ The breadcrumbs should start with your 'home' page and end with the parent secti
62
63
63
64
There are 2 ways to use the breadcrumbs component. You can use HTML or, if you are using [Nunjucks](https://mozilla.github.io/nunjucks/) or the [GOV.UK Prototype Kit](https://prototype-kit.service.gov.uk), you can use the Nunjucks macro.
If you have long breadcrumbs you can configure the component to only show the first and last items on mobile devices.
70
71
71
72
To do this, add a `govuk-breadcrumbs--collapse-on-mobile` class to the outer `<div>` element of the component HTML. Or if you’re using Nunjucks, add `collapseOnMobile: true` to the Nunjucks macro as shown in this example.
Use the `govuk-breadcrumbs--inverse` modifier class to show white links and arrows on dark backgrounds – for example, in headers, custom components, and patterns with darker backgrounds.
78
79
79
80
Make sure all users can see the breadcrumbs – the background colour [must have a contrast ratio of at least 4.5:1](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html) with white.
@@ -73,30 +74,30 @@ Use a default button for the main call to action on a page.
73
74
74
75
Avoid using multiple default buttons on a single page. Having more than one main call to action reduces their impact, and makes it harder for users to know what to do next.
Use secondary buttons for secondary calls to action on a page.
88
89
89
90
Pages with too many calls to action make it hard for users to know what to do next. Before adding lots of secondary buttons, try to simplify the page or break the content down across multiple pages.
You can also [group default and secondary buttons together](#grouping-buttons).
94
95
95
96
### Warning buttons
96
97
97
98
Warning buttons are designed to make users think carefully before they use them. They only work if used very sparingly. Most services should not need one.
Only use warning buttons for actions with serious destructive consequences that cannot be easily undone by a user. For example, permanently deleting an account.
102
103
@@ -112,25 +113,25 @@ Use the `govuk-button--inverse` modifier class to show white buttons on dark bac
112
113
113
114
Make sure all users can see the button – the white button and background colour [must have a contrast ratio of at least 3:1](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html).
### Stop users from accidentally sending information more than once
136
137
@@ -148,7 +149,7 @@ If you are working in production and research shows that users are frequently se
148
149
149
150
To do this, set the `data-prevent-double-click` attribute to `true`. You can do this directly in the HTML or, if you’re using Nunjucks, you can use the Nunjucks macro as shown in this example.
This feature will prevent double clicks for users that have JavaScript enabled, however you should also think about the issue server-side to protect against attacks.
@@ -46,21 +47,21 @@ This component uses JavaScript. If JavaScript is not available, users will see a
46
47
47
48
There are 2 ways to use the character count component. You can use HTML or, if you’re using Nunjucks or the GOV.UK Prototype Kit, you can use the Nunjucks macro.
### If you’re asking more than one question on the page
52
53
53
54
If you're asking more than one question on the page, do not set the contents of the `<label>` as the page heading. Read more about [asking multiple questions on question pages](/patterns/question-pages/#asking-multiple-questions-on-a-page).
@@ -74,13 +75,13 @@ To do this, set the threshold in the component markup as a percentage. For examp
74
75
75
76
Screen reader users will hear the character limit when they first interact with a textarea using the threshold option. Sighted users will not see anything until the count message is shown – though you might choose to include the character limit in the hint text.
0 commit comments