What's new Report an issue
GIG Cymru NHS Wales, Digital Health and Care Wales

Tags

A small pill that labels something — its status, its category, or how many of it there are.

Type: Status

A filled pill, and the one to reach for. Default 24px on the top row, Small 16px below.

StatusStatusStatusStatusStatusStatus
StatusStatusStatusStatusStatusStatus
<span class="sr-tag sr-tag--status sr-tag--blue sr-tag--default">
  <span>Pending</span>
</span>

Type: Filter

An outlined pill with a close button, for a filter the user can remove. The close button is the only interactive part, and its accessible name says what it removes.

StatusStatusStatusStatusStatus
StatusStatusStatusStatusStatus
<span class="sr-tag sr-tag--filter sr-tag--blue sr-tag--default">
  <span>Ward</span>
  <button type="button" class="sr-tag__close" aria-label="Remove Ward: Aneurin Bevan">
    <span class="sr-icon sr-icon--xs sr-icon--inherit">…</span>
  </button>
</span>

Type: Count

A 24px disc holding a number. Dark blue is count-only and is for the single primary total on a screen. The second row shows one, two and three digits — past two the circle becomes a pill rather than clipping the number.

0000000
842128
<!-- A circle up to two digits; add sr-tag--wide past that. -->
<span class="sr-tag sr-tag--count sr-tag--red">
  <span>3</span>
</span>

In context

A tag sits inline with the text it annotates, at the size of the body around it.

Awaiting validation Pending

Ward: Aneurin Bevan Ward

Unread results 3

A small pill that labels something, its status, its category, or how many of it there are.


When to use

When not to use


How it works

Three variants. They share one colour vocabulary, so a green tag means the same thing whichever shape it takes.

Colour is a secondary signal. The text carries the meaning in every case; the colour only reinforces it. "Overdue" in red is legible to someone who cannot see it is red, because it says "Overdue".

Sentence case, no full stop. "Awaiting approval", not "AWAITING APPROVAL" or "Awaiting approval.".


Options

VariantTypesSizesUse when
statusBlue, Green, Red, Yellow, Grey, OutlineDefault 24px · Small 16pxLabelling what something is or where it has got to
filterBlue, Green, Red, Yellow, BlackDefault 24px · Small 16pxShowing an applied filter the user can remove
countBlue, Green, Red, Yellow, Grey, Outline, Dark blue24px disc onlyShowing how many

Choosing a colour

TypeMeans
BlueInformational, in progress, neutral state
GreenComplete, approved, within range
RedNeeds attention, overdue, outside range
YellowWaiting, provisional, needs checking
GreyInactive, archived, not applicable
OutlineNo state at all, a category or a plain label

Dark blue is count-only, and it is for one thing per screen, the single total the screen is about. If two counts on a screen are dark blue, neither reads as primary.

Counts

A count is a circle, which holds two digits. Past that the React component switches it to a pill (sr-tag--wide) rather than clipping the number. If your counts routinely run into three digits, consider whether a number beside a label reads better than a badge.

Digits use tabular figures, so a column of counts lines up.


Do & don't

DoDon't
Keep the label to one or two wordsWrite a sentence inside a tag
Let the text carry the meaning, with colour reinforcing itUse colour as the only difference between two states
Use one dark-blue count per screen at mostMake every count dark blue because it looks stronger
Give the filter close button a specific name, "Remove Ward: Aneurin"Leave the close button labelled "Remove" with no object
Use Grey or Outline where there is no state to reportReach for Red because it stands out

Accessibility


Content


Frameworks

FrameworkStatusWhere
Web (HTML/CSS)Livepackages/web/src/tags/tags.css
ReactLivepackages/react/src/tags/Tag.jsx
Blazor /.NETNot built,
.NET MAUIStyle layerTagInfo / TagSuccess / TagWarning / TagCritical in Styles.xaml
Legacy (.NET 4.8 / Delphi)Tokens onlytoken CSS custom properties

Related

Accessibility requirements

RequirementWCAG SCHow Single Record meets itTest method
The filter close button is named for what it removes4.1.2 Name, Role, Value (A)closeLabel renders as aria-label — "Remove Ward: Aneurin Bevan", not a bare "Remove"Screen reader: each close button announces its own filter
Text meets 4.5:1 against its own fill1.4.3 Contrast (Minimum) (AA)Every type and variant pairing checked against the built tokens; the lowest is 5.19:1Contrast checker against the built token values
Colour is never the only carrier of meaning1.4.1 Use of Colour (A)Status and filter tags carry text; a count carries a numberView the page in greyscale — every tag still reads
Tags scale with text1.4.4 Resize Text (AA)Inline elements sized from the type scale; the count disc grows with its contentZoom to 200% and confirm nothing clips