Forms
Task list
The sections of a long application with the status of each, so people can do them in any order and come back later.
When to use
- For an application that takes more than one sitting, or has sections people can do in any order, such as a licence or a permit with several documents to upload.
- When people need to see what is left before they can send it.
When not to use
- For a short form that people finish in one go. Ask one question per page, with progress if it helps.
- To show the stages of something your institution does after people apply. Use a timeline.
How to use
- Put the summary first: "You have completed 2 of 5 sections." Then the list, then a button to check answers and send, once every section is complete.
- Name each section by what people do or give: "Your details", "Upload your documents", "Pay the fee".
- Give each section one status, as text: Completed, In progress, Not started or Cannot start yet. Use the tag colours as in the example. Only completed is green.
- Link every section people can open. A section that cannot start yet (such as paying before the details are done) has no link, and its hint says why.
- Give each link
aria-describedbynaming its status, so screen readers hear "Your details, Completed". - Save each section as people finish it, so they can leave and come back.
Accessibility
What GGDS does
- The whole row is the target, at least 44px tall, while the link text stays the link's name.
- Status is in words, never colour alone.
What you need to do
- Link each section's status to its link with
aria-describedby. - Keep the summary up to date: it is the first thing people read when they come back.
Example: An application in sections
<h1>Apply for a fishing licence</h1>
<p class="ggds-task-list__summary">You have completed 2 of 5 sections.</p>
<ol class="ggds-task-list">
<li class="ggds-task-list__item ggds-task-list__item--link">
<div class="ggds-task-list__name"><a class="ggds-task-list__link" href="#details" aria-describedby="task-details-status">Your details</a></div>
<div class="ggds-task-list__status" id="task-details-status"><strong class="ggds-tag ggds-tag--success">Completed</strong></div>
</li>
<li class="ggds-task-list__item ggds-task-list__item--link">
<div class="ggds-task-list__name"><a class="ggds-task-list__link" href="#canoe" aria-describedby="task-canoe-status">About your canoe</a></div>
<div class="ggds-task-list__status" id="task-canoe-status"><strong class="ggds-tag ggds-tag--success">Completed</strong></div>
</li>
<li class="ggds-task-list__item ggds-task-list__item--link">
<div class="ggds-task-list__name"><a class="ggds-task-list__link" href="#documents" aria-describedby="task-documents-hint task-documents-status">Upload your documents</a><p class="ggds-task-list__hint" id="task-documents-hint">Your Ghana Card and a photo of the canoe</p></div>
<div class="ggds-task-list__status" id="task-documents-status"><strong class="ggds-tag ggds-tag--info">In progress</strong></div>
</li>
<li class="ggds-task-list__item ggds-task-list__item--link">
<div class="ggds-task-list__name"><a class="ggds-task-list__link" href="#landing" aria-describedby="task-landing-status">Your landing beach</a></div>
<div class="ggds-task-list__status" id="task-landing-status"><strong class="ggds-tag">Not started</strong></div>
</li>
<li class="ggds-task-list__item">
<div class="ggds-task-list__name">Pay the fee<p class="ggds-task-list__hint" id="task-pay-hint">You can pay once the other sections are complete</p></div>
<div class="ggds-task-list__status ggds-task-list__status--cannot-start" id="task-pay-status">Cannot start yet</div>
</li>
</ol><>
<h1>Apply for a fishing licence</h1>
<p className="ggds-task-list__summary">You have completed 2 of 5 sections.</p>
<ol className="ggds-task-list">
<li className="ggds-task-list__item ggds-task-list__item--link">
<div className="ggds-task-list__name"><a className="ggds-task-list__link" href="#details" aria-describedby="task-details-status">Your details</a></div>
<div className="ggds-task-list__status" id="task-details-status"><strong className="ggds-tag ggds-tag--success">Completed</strong></div>
</li>
<li className="ggds-task-list__item ggds-task-list__item--link">
<div className="ggds-task-list__name"><a className="ggds-task-list__link" href="#canoe" aria-describedby="task-canoe-status">About your canoe</a></div>
<div className="ggds-task-list__status" id="task-canoe-status"><strong className="ggds-tag ggds-tag--success">Completed</strong></div>
</li>
<li className="ggds-task-list__item ggds-task-list__item--link">
<div className="ggds-task-list__name"><a className="ggds-task-list__link" href="#documents" aria-describedby="task-documents-hint task-documents-status">Upload your documents</a><p className="ggds-task-list__hint" id="task-documents-hint">Your Ghana Card and a photo of the canoe</p></div>
<div className="ggds-task-list__status" id="task-documents-status"><strong className="ggds-tag ggds-tag--info">In progress</strong></div>
</li>
<li className="ggds-task-list__item ggds-task-list__item--link">
<div className="ggds-task-list__name"><a className="ggds-task-list__link" href="#landing" aria-describedby="task-landing-status">Your landing beach</a></div>
<div className="ggds-task-list__status" id="task-landing-status"><strong className="ggds-tag">Not started</strong></div>
</li>
<li className="ggds-task-list__item">
<div className="ggds-task-list__name">Pay the fee<p className="ggds-task-list__hint" id="task-pay-hint">You can pay once the other sections are complete</p></div>
<div className="ggds-task-list__status ggds-task-list__status--cannot-start" id="task-pay-status">Cannot start yet</div>
</li>
</ol>
</>Use it
- Stylesheet
ggds.cssincludes it. To load only the parts you use:core.css, thencomponents/task-list.css(0.5 KB with gzip, minified).- JavaScript
- None needed.
HTML
Copy the HTML under each example above. It works in any website.
Astro
With @ggds/astro:
import TaskList from '@ggds/astro/TaskList.astro';
---
import TaskList from '@ggds/astro/TaskList.astro';
---
<TaskList tasks={[
{ label: 'Your details', href: '/apply/details/', status: 'completed' },
{ label: 'Pay the fee', status: 'cannotStart', hint: 'You can pay once the other sections are complete' },
]} />React and Next.js
With @ggds/react:
import { TaskList } from '@ggds/react';
<TaskList tasks={[
{ label: 'Your details', href: '/apply/details/', status: 'completed' },
{ label: 'Upload your documents', href: '/apply/documents/', status: 'inProgress' },
{ label: 'Pay the fee', status: 'cannotStart', hint: 'You can pay once the other sections are complete' },
]} /> {/* "You have completed 1 of 3 sections." */}Django
With ggds-django ({% load ggds %}):
{% load ggds %}
{% ggds_task_list tasks %} {# [{"label", "href", "status": "completed" | "inProgress" | "notStarted" | "cannotStart", "hint"}] #}Classes and states
| Class | What it does |
|---|---|
.ggds-task-list__summary | How many sections are complete, above the list. |
.ggds-task-list | The list of sections, in an <ol>. |
.ggds-task-list__item | One section: its name and its status. |
.ggds-task-list__item--link | A section people can open: the whole row is the target. |
.ggds-task-list__name | The section's name, as a link when people can open it, and its hint. |
.ggds-task-list__link | The link to the section. Its aria-describedby names the status. |
.ggds-task-list__hint | Extra help under the name, such as why a section cannot start yet. |
.ggds-task-list__status | The status: a tag, or plain text for a section that cannot start yet. |
.ggds-task-list__status--cannot-start | The muted text of a section people cannot open yet. |
| State | What it does |
|---|---|
:hover | The row's background turns grey. |
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
- Behaviour test: “task list: the whole row opens the section, and screen readers hear its status”
By people, with assistive technology
Automated tests find only some of the barriers people meet. These checks are still to be done.
| Check | Result | Notes |
|---|---|---|
| Keyboard only | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| NVDA screen reader with Firefox or Chrome (Windows) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| JAWS screen reader with Chrome (Windows) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| VoiceOver screen reader with Safari (iPhone) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| TalkBack screen reader with Chrome (Android) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Zoom to 400%, and increased text spacing | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Windows contrast themes (forced colours) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
| Voice control (Voice Access or Dragon) | Not tested yet | Waiting for the external audit with disabled people (decision D-09). |
Changes
| Version | Change |
|---|---|
| 0.4.0 | New components for services that take people from start to payment, in HTML, React, Astro and Django, each checked element by element against its documentation example and with axe on phones and computers. All are alpha. |
| 0.1.0 | Added. |
Related components
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.