Content presentation
–
Tag
WCAG 2.2: Make sure that users can successfully interact with tags without relying on click and drag movements (if you choose to add functionality to reorder tags).
When to use a tag
Use the tag component when it's possible for something to have more than 1 status and it's useful for the user to know about that status. For example, you can use a tag to show whether an item in a task list has been "completed".
How it works
Tags are just used to indicate a status. Do not add links. Use adjectives rather than verbs for the names of your tags. Using a verb might make a user think that clicking on them will do something.
Showing 1 or 2 statuses
Sometimes a single status is enough. For example, if you need to tell users which parts of an application they've finished and which they have not, you may only need a "Completed" tag. Because the user understands that if something does not have a tag, that means it's incomplete.
Or it can make sense to have 2 statuses. For example, you may find that you need 1 tag for "Active" users and 1 for "Inactive" users.
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. Deprecated options are marked as "Deprecated".
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.
| Name | Type | Description |
|---|---|---|
| id | string | The ID of the tag. |
| text | string |
Required.
If html is set, this is not required. Text to use within the tag component. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the tag component. If html is provided, the text argument will be ignored.
|
| classes | string | Classes to add to the tag. |
| attributes | object | HTML attributes (for example data attributes) to add to the tag. |
| colour | string |
Optional colour modifier for the tag – "white", "grey", "green", "aqua-green", "blue", "purple", "pink", "red", "orange" or "yellow".
|
| border | boolean |
If set to false, remove border from the tag.
|
Showing multiple statuses
Tags should be helpful to users. The more you add, the harder it is for users to remember them. So start with the smallest number of statuses you think might work, then add more if your user research shows there's a need for them.
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. Deprecated options are marked as "Deprecated".
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.
| Name | Type | Description |
|---|---|---|
| id | string | The ID of the tag. |
| text | string |
Required.
If html is set, this is not required. Text to use within the tag component. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the tag component. If html is provided, the text argument will be ignored.
|
| classes | string | Classes to add to the tag. |
| attributes | object | HTML attributes (for example data attributes) to add to the tag. |
| colour | string |
Optional colour modifier for the tag – "white", "grey", "green", "aqua-green", "blue", "purple", "pink", "red", "orange" or "yellow".
|
| border | boolean |
If set to false, remove border from the tag.
|
Any tag implementation that allows the user to change the order of tags must offer a way to do so without relying on click and drag movements. This is to comply with WCAG 2.2 success criterion 2.5.7 Dragging Movements (W3C).
Using colour with tags
You can use colour to help distinguish between different tags – or to help draw the user's attention to a tag if it's especially important. For example, it makes sense to use nhsuk-tag--red for a tag that reads "Urgent".
Do not rely on colour alone to convey information because it's not accessible. If you use the same tag in more than 1 place, make sure you keep the colour consistent.
Because tags with solid colours tend to stand out more, it's usually best to avoid mixing solid colours and tints: use one or the other. This matters less if you're only using 2 colours. For example, it's okay to use the tint nhsuk-tag--grey and solid blue tags together if you only need 2 statuses.
We use a border of the same colour as the tag text to stand out against the NHS page background colour.
Additional colours
If you need more tag colours, you can use the following tints.
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. Deprecated options are marked as "Deprecated".
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.
| Name | Type | Description |
|---|---|---|
| id | string | The ID of the tag. |
| text | string |
Required.
If html is set, this is not required. Text to use within the tag component. If html is provided, the text argument will be ignored.
|
| html | string |
Required.
If text is set, this is not required. HTML to use within the tag component. If html is provided, the text argument will be ignored.
|
| classes | string | Classes to add to the tag. |
| attributes | object | HTML attributes (for example data attributes) to add to the tag. |
| colour | string |
Optional colour modifier for the tag – "white", "grey", "green", "aqua-green", "blue", "purple", "pink", "red", "orange" or "yellow".
|
| border | boolean |
If set to false, remove border from the tag.
|
Accessibility
All contrasts between text and background meet level AAA of WCAG 2.0. Read more about accessibility and colour.
Research
We have tested tags in the NHS e-referral service, the "Submit your electronic declaration" service and the NHS App prescriptions service. We found that they helped users:
- make a decision about whether or not to proceed with their journey
- understand their progress or the status of an order
- save time as they could see the information they needed quickly
We also found that it helped to use sentence case rather than block capitals for readability.
Help us improve this guidance
Share insights or feedback and take part in the discussion. We use GitHub as a collaboration space. All the information on it is open to the public.
Feed back or share insights on GitHubRead more about how to feed back or share insights.
If you have any questions, get in touch with the service manual team.
Updated: November 2025