Skip to main content

This is a draft (version 0.5.0). The National Information Technology Agency (NITA) plans to make GGDS official guidance for government websites after independent accessibility testing. What this means

Ghana Government Design System Design system for Government of Ghana websites – home Search

Content

Tag

A short label that shows a status, such as "Open" or "Closed".

When to use

  • To show the status of an item in a list or on a page: a licence, a consultation, an application.
  • When people need to scan many items and pick out the ones in a certain state.

When not to use

  • As a link, button or filter. Tags have no hover or focus style, so people will not know they can press them.
  • For a message people must read or act on. Use a notice.
  • For categories or keywords. Write them as plain text or links.

How to use

  • Use one to three words, such as "In force" or "Closing soon".
  • Choose the style by meaning: ggds-tag--success for a good or settled state ("Approved", "In force"), ggds-tag--info for something new or open ("New", "Open for comment"), ggds-tag--warning for something that needs attention soon ("Closing soon", "To be confirmed"), ggds-tag--danger for something stopped or refused ("Revoked", "Rejected"), and plain ggds-tag when the state is neither good nor bad ("Closed", "Draft").
  • Use the same word and style for the same status everywhere on your website.
  • Put the tag next to the thing it describes, such as after a title.
  • Use only one tag per item. If an item needs several, the status is not clear yet.

Do

  • Use words that make sense alone: "Closing soon".
  • Keep a short list of statuses and use it everywhere.

Don't

  • Rely on colour: a red tag saying "Status" tells people nothing.
  • Write a sentence in a tag.

Accessibility

What GGDS does

  • Every tag's text colour is checked against its background for at least 4.5:1 contrast by the GGDS tests (WCAG 1.4.3).
  • Tags are bold and have a border in the text colour, so they keep their shape even where background colours are not shown.

What you need to do

  • Let the words carry the meaning; the colour only supports them (WCAG 1.4.1).
  • Check the tag reads well in order: a screen reader reads it as plain text with the words around it. If it is unclear, add visually hidden text such as <span class="ggds-visually-hidden">Status: </span>.
  • Do not make a tag a link or button.

Example: Status tags

Open this example on its own page

HTML code for “Status tags”
HTML
<p>
  <strong class="ggds-tag ggds-tag--success">In force</strong>
  <strong class="ggds-tag ggds-tag--info">Open for comment</strong>
  <strong class="ggds-tag ggds-tag--warning">To be confirmed</strong>
  <strong class="ggds-tag ggds-tag--danger">Revoked</strong>
  <strong class="ggds-tag">Closed</strong>
</p>
JSX (React)
<p>
  <strong className="ggds-tag ggds-tag--success">In force</strong>
  <strong className="ggds-tag ggds-tag--info">Open for comment</strong>
  <strong className="ggds-tag ggds-tag--warning">To be confirmed</strong>
  <strong className="ggds-tag ggds-tag--danger">Revoked</strong>
  <strong className="ggds-tag">Closed</strong>
</p>

Use it

Stylesheet
ggds.css includes it. To load only the parts you use: core.css, then components/tag.css (0.3 KB with gzip, minified).
JavaScript
None needed.

HTML

Copy the HTML under each example above. It works in any website.

Astro

No Astro component: copy the HTML.

React and Next.js

With @ggds/react:

JavaScript
import { Tag } from '@ggds/react';

<Tag type="success">In force</Tag>

Django

No template tag: copy the HTML into your template.

Classes and states

Classes for tag
ClassWhat it does
.ggds-tagA neutral tag, such as "Closed" or "Draft".
.ggds-tag--infoInformation, such as "New".
.ggds-tag--successA good state, such as "Open".
.ggds-tag--warningNeeds attention, such as "Closing soon".
.ggds-tag--dangerA bad outcome, such as "Revoked" or "Rejected".

Accessibility tests

Automated, on every change

These run each time GGDS changes. A change that fails one is not accepted.

  • WCAG 2.2 A and AA rules (axe), at desktop and phone widths, on every example
  • No sideways scrolling on a 320px screen, also with a wide font, on every example
  • Every approved colour pair meets its contrast minimum, for every institution theme
  • No inline scripts or styles, so it runs under a strict Content Security Policy

By people, with assistive technology

Automated tests find only some of the barriers people meet. These checks are still to be done.

Manual accessibility checks for tag
CheckResultNotes
Keyboard onlyNot tested yetWaiting for the external audit with disabled people (decision D-09).
NVDA screen reader with Firefox or Chrome (Windows)Not tested yetWaiting for the external audit with disabled people (decision D-09).
JAWS screen reader with Chrome (Windows)Not tested yetWaiting for the external audit with disabled people (decision D-09).
VoiceOver screen reader with Safari (iPhone)Not tested yetWaiting for the external audit with disabled people (decision D-09).
TalkBack screen reader with Chrome (Android)Not tested yetWaiting for the external audit with disabled people (decision D-09).
Zoom to 400%, and increased text spacingNot tested yetWaiting for the external audit with disabled people (decision D-09).
Windows contrast themes (forced colours)Not tested yetWaiting for the external audit with disabled people (decision D-09).
Voice control (Voice Access or Dragon)Not tested yetWaiting for the external audit with disabled people (decision D-09).

Changes

Changes to tag, newest first
VersionChange
0.2.0Fuller guidance for tags, breadcrumbs, disclosures, the skip link, pagination, rich text, tables and tab links.
0.1.0Added.

Every change, in What’s new

  • Notice

    A message box for information, success, a warning or danger, and an urgent notice for the whole site.

  • Card

    A box that sums up a page, service or document and links to it.

Back to top

Something wrong, unclear or missing? Report a problem with this page or suggest a change to it on GitHub. You need a GitHub account.