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

Navigation

Breadcrumbs

A trail of links showing where the page sits in the website.

When to use

  • On every page below the homepage, when your website has more than two levels.
  • When people often arrive on a deep page from a search engine and need a way up.

When not to use

  • On the homepage.
  • To show steps in a form. Breadcrumbs take people out of the form.
  • As the only way to move around. People still need the header.

How to use

  • Put the breadcrumbs at the top of the page, above the main heading.
  • Start with "Home", then one link for each level above this page.
  • Show where the page sits in the website, not the pages the visitor came through.
  • Use the same names as the pages' headings, shortened if they are long.
  • The last item is the current page. Do not link it, and mark it with aria-current="page".
  • On a narrow phone the trail wraps onto more lines; nothing is cut off. Short names keep it to one or two lines.

Do

  • Keep the trail the same on every page in a section.
  • Use short names: "Services", not "Our services to the public".

Don't

  • Link the current page to itself.
  • Type ">" or "/" between items; GGDS draws the arrows.

Accessibility

What GGDS does

  • It is a navigation area with an ordered list, so screen readers say how many steps there are.
  • The arrows between steps are drawn in CSS, so screen readers do not read them out.
  • Each link is at least 24px tall (WCAG 2.5.8), and the trail wraps instead of making the page scroll sideways.

What you need to do

  • Name it: <nav aria-label="Breadcrumb">.
  • Make the last step the current page: not a link, with aria-current="page".
  • Use one breadcrumb trail per page.

Example: Breadcrumbs

Open this example on its own page

HTML code for “Breadcrumbs”
HTML
<nav class="ggds-breadcrumbs" aria-label="Breadcrumb">
  <ol class="ggds-breadcrumbs__list">
    <li class="ggds-breadcrumbs__item"><a class="ggds-breadcrumbs__link" href="/">Home</a></li>
    <li class="ggds-breadcrumbs__item"><a class="ggds-breadcrumbs__link" href="/services/">Services</a></li>
    <li class="ggds-breadcrumbs__item" aria-current="page">Apply for a licence</li>
  </ol>
</nav>
JSX (React)
<nav className="ggds-breadcrumbs" aria-label="Breadcrumb">
  <ol className="ggds-breadcrumbs__list">
    <li className="ggds-breadcrumbs__item"><a className="ggds-breadcrumbs__link" href="/">Home</a></li>
    <li className="ggds-breadcrumbs__item"><a className="ggds-breadcrumbs__link" href="/services/">Services</a></li>
    <li className="ggds-breadcrumbs__item" aria-current="page">Apply for a licence</li>
  </ol>
</nav>

Use it

Stylesheet
ggds.css includes it. To load only the parts you use: core.css, then components/navigation.css (0.9 KB with gzip, minified), which also holds breadcrumbs, pagination and tab links.
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 { Breadcrumbs } from '@ggds/react';

<Breadcrumbs current="Apply for a licence"
  items={[{ label: 'Home', href: '/' }, { label: 'Services', href: '/services/' }]} />

Django

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

Django template
{% ggds_breadcrumbs crumbs %}

Classes and states

Classes for breadcrumbs
ClassWhat it does
.ggds-breadcrumbsThe <nav aria-label="Breadcrumb">.
.ggds-breadcrumbs__listThe trail, as an ordered list that wraps.
.ggds-breadcrumbs__itemOne step, with an arrow drawn before every step after the first.
.ggds-breadcrumbs__linkA link to a page above this one.
States of breadcrumbs
StateWhat it does
aria-current="page" on the last itemThe current page: plain text, not a link.

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 breadcrumbs
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 breadcrumbs, newest first
VersionChange
0.2.0Fuller guidance for tags, breadcrumbs, disclosures, the skip link, pagination, rich text, tables and tab links.
0.1.0New: ggds-django, for Django and Django-based CMSs such as Wagtail: the page parts as template tags, a form renderer that turns any Django form into GGDS markup with an error summary and accessible errors, and the GGDS styles, themes and script as static files.
0.1.0Added.

Every change, in What’s new

  • Header and main navigation

    Your institution's logo and name, the main sections and search, at the top of every page.

  • Page template

    How the parts of a page fit together, in the same order on every government website.

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.