Components

Tag

A component to display the status of something.

Completed
Props
NameTypeDefaultDescription
idother'id' attribute to place on the base HTML element
classBlockotherBlock name override in BEM style classes applied to all elements
classModifiersotherBEM style modifiers to apply to the base HTML element
classNameotherExtra classes to apply to the base HTML element
textotherText to be displayed within the tag

When to use this component

Use the tag component when it’s possible for something to have more than one 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, so 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.

Stories

Standard

A standard Tag.

Completed

Showing one or two 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 haven’t, you may only need a ‘Completed’ tag. Because the user understands that if something doesn’t have a tag, that means it’s incomplete.

The [task list pattern] has an example of how to show one status using tags.

Or it can make sense to have two statuses. For example you may find that there’s a need to have one tag for ‘Active’ users and one for ‘Inactive’ users.

Name of userStatus
Rachel SilverInactive
Jesse SmithInactive
Joshua WesselActive
Rachel PepperActive
Stuart SayInactive
Laura FrithActive
Tim HarveyInactive

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.

ApplicatonStatus
Joshua WesselUrgent
Rachel SilverNew
Laura FrithNew
Paul FrenchNew
Jesse SmithNew
Rachel PepperFinished
Emma TennantWaiting on

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 probably makes sense to use red for a tag that reads ‘Urgent’.

Do not use colour alone to convey information because it’s not accessible. If you use the same tag in more than one 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 two colours. For example, it’s okay to use the tint grey and solid blue tags together if you only need two statuses.

Additional colours

If you need more tag colours, you can use the following tints.

classModifierTag
greyInactive
greenNew
turquoiseActive
bluePending
purpleReceived
pinkSent
redRejected
orangeDeclined
yellowDelayed

Research on this component

The Department for Education contributed the coloured tags. They’re being used in:

  • apply for teacher training (used by citizens)
  • manage teacher training applications (used by teacher training providers)