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

Forms

Progress

Shows people how far through a task they are, such as “Question 3 of 4”, in words and as a bar.

When to use

  • On each question page of a service with 3 or more pages, so people know how much is left.
  • On a card for an application, to show which stage it has reached.

When not to use

  • On a service with 1 or 2 pages: it adds nothing.
  • When the number of pages depends on the answers and you cannot say it: say “Question 3” only, or leave it out. A total that changes is worse than none.
  • For an amount, such as rainfall: use a meter.
  • For time passing while something loads: GGDS pages should load fast enough not to need it.

How to use

  • Put it above the page’s <h1>.
  • Write the words in the label: “Question 3 of 4”, “Step 2 of 4: your canoe”, “Done”. The bar only repeats them.
  • Use a native <progress> with value and max: no style attributes, so it works under a strict Content Security Policy. Link the label to it with for and id.
  • Count the check answers page as a step, and leave out the confirmation page.

Do

  • Say the step in words.
  • Keep the total the same on every page.

Don't

  • Show percentages.
  • Make the bar a link or a button.

Accessibility

What GGDS does

  • The bar is a native <progress>, so screen readers say its name and how far along it is (WCAG 4.1.2).
  • The label is text with at least 4.5 to 1 contrast; the bar is not the only way to see the step (WCAG 1.4.1).
  • In Windows contrast themes the bar keeps an outline.

What you need to do

  • Give the <progress> a label, with for and id, so screen readers say what it measures.
  • Put the same words inside the <progress> element too, for browsers that do not draw it.

Example: Question 3 of 4

Open this example on its own page

HTML code for “Question 3 of 4”
HTML
<div class="ggds-progress">
  <label class="ggds-progress__label" for="form-progress">Question 3 of 4</label>
  <progress class="ggds-progress__bar" id="form-progress" value="3" max="4">Question 3 of 4</progress>
</div>
<h1>Choose a time</h1>
JSX (React)
<>
  <div className="ggds-progress">
    <label className="ggds-progress__label" htmlFor="form-progress">Question 3 of 4</label>
    <progress className="ggds-progress__bar" id="form-progress" value="3" max="4">Question 3 of 4</progress>
  </div>
  <h1>Choose a time</h1>
</>

Use it

Stylesheet
ggds.css includes it. To load only the parts you use: core.css, then components/progress.css (0.4 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 { Progress } from '@ggds/react';

<Progress current={3} total={4} />   {/* "Question 3 of 4" */}

Django

With ggds-django ({% load ggds %}):

Django template
{% ggds_progress 3 4 %}

Classes and states

Classes for progress
ClassWhat it does
.ggds-progressThe label and the bar together.
.ggds-progress__labelThe words: “Question 3 of 4”. A <label> for the bar.
.ggds-progress__barThe bar: a native <progress> with value and max.

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 progress
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 progress, newest first
VersionChange
0.3.0New: progress, "Question 3 of 4" in words and as a native <progress>, so it needs no style attributes.
0.1.0Added.

Every change, in What’s new

  • Text input, textarea, select and file upload

    A single form question with a label, an optional hint and an error message.

  • Summary list

    Questions and answers, or labels and values, as a list, with links to change them. For "Check your answers" pages and records.

  • Confirmation panel

    The top of the page people see when they have finished a task: that it worked, and their reference number.

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.