Skip to main content

Buttons

Use buttons to help users carry out an action on a page like starting an application or saving their progress.

We have 3 buttons

Primary button

Open in new window
Copy
<button class="nhsuk-button" type="submit">
  Save and continue
</button>
Copy
{% from 'button/macro.njk' import button %}

{{ button({
  "text": "Save and continue"
}) }}

When to use a primary button

Use a primary button to help users carry out an action on a page like starting an application or saving their progress.

More about when to use and not use buttons.

Secondary button

Open in new window
Copy
<button class="nhsuk-button nhsuk-button--secondary" type="submit">
  Find my location
</button>
Copy
{% from 'button/macro.njk' import button %}

{{ button({
  "text": "Find my location",
  "classes": "nhsuk-button--secondary"
}) }}

When to use a secondary button

Use a secondary button on pages that have more than 1 action or when users aren't noticing standard link text.

More about when to use and not use buttons.

White button on solid background colour (reverse button)

Open in new window
Copy
<button class="nhsuk-button nhsuk-button--reverse" type="submit">
  Save and continue
</button>
Copy
{% from 'button/macro.njk' import button %}

{{ button({
  "text": "Save and continue",
  "classes": "nhsuk-button--reverse"
}) }}

When to use a white button on solid background colour

White buttons on solid background colour are good on components like interruption cards where link text, primary and secondary buttons would be lost. (There's an example on Find out why your NHS data matters.)

More about when to use and not use buttons.

When to use buttons

Use buttons to start or save transactional journeys.

When not to use buttons

Do not use buttons as links:

  • to pages which aren't part of your user journey
  • from 1 flat content page to another
  • to external websites

Try not to have multiple buttons on 1 page. Follow GOV.UK guidance on One thing per page.

How to use buttons

The GOV.UK Design System suggests using a button to help users carry out an action on a page like starting an application or saving their progress.

Write button text in sentence case and describe the action the button performs. For example "Save and continue" or "Start now".

Align the primary action button to the left edge of your form.

Disabled buttons

Disabled buttons have poor contrast and can confuse some users. Only use them if user research shows it makes things easier for users to understand.

We have developed disabled versions of the 3 buttons but we haven't tested them yet. You can get the latest disabled button code in the NHS.UK frontend library in GitHub.

Accessibility

Make sure the text you use describes the action.

All 3 active buttons pass AAA guidelines for colour contrast. The colour contrast ratio between text and background colour is as follows:

  • primary button 5.12:1
  • secondary button 7.75:1
  • white button on solid background colour 14.42:1

Please note that the disabled versions of the 3 buttons do not meet accessibility colour contrast ratios. If your team has discovered a user need for disabled buttons, use them carefully and test them with users with access needs.

Research

We based our buttons on the GOV.UK designs. But because our logo is a blue rectangle and a number of our components (including panel headings) have squared edges, we decided that GOV.UK buttons didn’t stand out enough. The square buttons didn't look clickable next to the other square components.

We made the buttons more "buttony" by rounding the corners (adding corner radiuses). There is research to suggest that rounded corners make things more clickable.

Our testing confirmed this. Users were able to complete tasks using buttons and they didn’t confuse them with non-clickable components.

Discuss

Discuss buttons on GitHub

Get in touch

If you have a question:

Updated: February 2019