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

Page structure

Header and main navigation

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

When to use

  • On every page, straight after the banner.

When not to use

  • For links within one section. Use tab links or a list on the page instead.

How to use

  • Use your approved logo. Until you have one, use your initials in the round badge (ggds-header__monogram).
  • If your name is longer than 45 characters, add ggds-header__name--long. It sets the name smaller on phones.
  • Mark the section the visitor is in with aria-current="page".
  • Point Search at your website's search page.
  • Below 1280px wide, the sections move behind a menu button. The menu pushes the page down instead of covering it. Without JavaScript the sections show as a list under the name.

Do

  • Keep to six sections or fewer, with short names.
  • Name sections after what people do: "Services", "Complaints".

Don't

  • Name sections after departments people do not know.
  • Add a second row of links to the header.

Accessibility

What GGDS does

  • The current section is shown by more than colour: a line beside it on phones and an underline on wide screens.
  • The menu pushes the page down instead of covering it, so keyboard users never land on content they cannot see. Escape closes it and returns focus to the menu button.
  • The page leaves room under the sticky header, so focused links are never hidden behind it.
  • Without JavaScript the sections show as a list, so nothing depends on the script.

What you need to do

  • Mark the current section with aria-current="page".
  • Give a logo image alt text naming your institution, or use the initials, which are hidden from screen readers because the name follows.
  • Keep section names short so the menu stays easy to scan.

Example: Header with main navigation

Open this example on its own page

HTML code for “Header with main navigation”
HTML
<header class="ggds-header">
  <div class="ggds-container ggds-header__inner">
    <a class="ggds-header__identity" href="/">
      <span class="ggds-header__monogram" aria-hidden="true">EA</span>
      <span class="ggds-header__text">
        <span class="ggds-header__name">Example Agency</span>
        <span class="ggds-header__country">Republic of Ghana</span>
        <span class="ggds-visually-hidden"> – home</span>
      </span>
    </a>
    <nav class="ggds-header__nav" id="ggds-header-nav" aria-label="Main">
      <ul class="ggds-header__list">
        <li><a class="ggds-header__link" href="/services/" aria-current="page">Services</a></li>
        <li><a class="ggds-header__link" href="/regulation/">Laws &amp; regulations</a></li>
        <li><a class="ggds-header__link" href="/news-notices/">News &amp; notices</a></li>
        <li><a class="ggds-header__link" href="/about/">About &amp; contact</a></li>
      </ul>
    </nav>
    <a class="ggds-header__search" href="/search/"><svg class="ggds-header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg><span class="ggds-header__search-label">Search</span></a>
    <button type="button" class="ggds-header__menu-button" aria-controls="ggds-header-nav" aria-expanded="false" hidden><svg class="ggds-header__icon ggds-header__icon--menu" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 6h16M4 12h16M4 18h16"/></svg><svg class="ggds-header__icon ggds-header__icon--close" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg><span class="ggds-visually-hidden">Menu</span></button>
  </div>
</header>
JSX (React)
<header className="ggds-header">
  <div className="ggds-container ggds-header__inner">
    <a className="ggds-header__identity" href="/">
      <span className="ggds-header__monogram" aria-hidden="true">EA</span>
      <span className="ggds-header__text">
        <span className="ggds-header__name">Example Agency</span>
        <span className="ggds-header__country">Republic of Ghana</span>
        <span className="ggds-visually-hidden"> – home</span>
      </span>
    </a>
    <nav className="ggds-header__nav" id="ggds-header-nav" aria-label="Main">
      <ul className="ggds-header__list">
        <li><a className="ggds-header__link" href="/services/" aria-current="page">Services</a></li>
        <li><a className="ggds-header__link" href="/regulation/">Laws &amp; regulations</a></li>
        <li><a className="ggds-header__link" href="/news-notices/">News &amp; notices</a></li>
        <li><a className="ggds-header__link" href="/about/">About &amp; contact</a></li>
      </ul>
    </nav>
    <a className="ggds-header__search" href="/search/"><svg className="ggds-header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg><span className="ggds-header__search-label">Search</span></a>
    <button type="button" className="ggds-header__menu-button" aria-controls="ggds-header-nav" aria-expanded="false" hidden><svg className="ggds-header__icon ggds-header__icon--menu" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><path d="M4 6h16M4 12h16M4 18h16" /></svg><svg className="ggds-header__icon ggds-header__icon--close" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18" /></svg><span className="ggds-visually-hidden">Menu</span></button>
  </div>
</header>

Open this example on its own page

HTML code for “Header with logo and a long name”
HTML
<header class="ggds-header">
  <div class="ggds-container ggds-header__inner">
    <a class="ggds-header__identity" href="/">
      <img class="ggds-header__logo" src="../../assets/example-logo.svg" alt="" width="44" height="44">
      <span class="ggds-header__text">
        <span class="ggds-header__name ggds-header__name--long">Ministry of Example Services, Digital Affairs and Innovation</span>
        <span class="ggds-header__country">Republic of Ghana</span>
        <span class="ggds-visually-hidden"> – home</span>
      </span>
    </a>
    <nav class="ggds-header__nav" id="ggds-header-nav" aria-label="Main">
      <ul class="ggds-header__list">
        <li><a class="ggds-header__link" href="/our-agencies/">Agencies</a></li>
        <li><a class="ggds-header__link" href="/regulation/">Laws &amp; regulations</a></li>
        <li><a class="ggds-header__link" href="/news-notices/">News &amp; notices</a></li>
        <li><a class="ggds-header__link" href="/about/">About &amp; contact</a></li>
      </ul>
    </nav>
    <a class="ggds-header__search" href="/search/"><svg class="ggds-header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg><span class="ggds-header__search-label">Search</span></a>
    <button type="button" class="ggds-header__menu-button" aria-controls="ggds-header-nav" aria-expanded="false" hidden><svg class="ggds-header__icon ggds-header__icon--menu" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 6h16M4 12h16M4 18h16"/></svg><svg class="ggds-header__icon ggds-header__icon--close" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg><span class="ggds-visually-hidden">Menu</span></button>
  </div>
</header>
JSX (React)
<header className="ggds-header">
  <div className="ggds-container ggds-header__inner">
    <a className="ggds-header__identity" href="/">
      <img className="ggds-header__logo" src="../../assets/example-logo.svg" alt="" width="44" height="44" />
      <span className="ggds-header__text">
        <span className="ggds-header__name ggds-header__name--long">Ministry of Example Services, Digital Affairs and Innovation</span>
        <span className="ggds-header__country">Republic of Ghana</span>
        <span className="ggds-visually-hidden"> – home</span>
      </span>
    </a>
    <nav className="ggds-header__nav" id="ggds-header-nav" aria-label="Main">
      <ul className="ggds-header__list">
        <li><a className="ggds-header__link" href="/our-agencies/">Agencies</a></li>
        <li><a className="ggds-header__link" href="/regulation/">Laws &amp; regulations</a></li>
        <li><a className="ggds-header__link" href="/news-notices/">News &amp; notices</a></li>
        <li><a className="ggds-header__link" href="/about/">About &amp; contact</a></li>
      </ul>
    </nav>
    <a className="ggds-header__search" href="/search/"><svg className="ggds-header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg><span className="ggds-header__search-label">Search</span></a>
    <button type="button" className="ggds-header__menu-button" aria-controls="ggds-header-nav" aria-expanded="false" hidden><svg className="ggds-header__icon ggds-header__icon--menu" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><path d="M4 6h16M4 12h16M4 18h16" /></svg><svg className="ggds-header__icon ggds-header__icon--close" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18" /></svg><span className="ggds-visually-hidden">Menu</span></button>
  </div>
</header>

Example: Header in an agency theme

Open this example on its own page

HTML code for “Header in an agency theme”
HTML
<div data-ggds-theme="gdcl">
<header class="ggds-header">
  <div class="ggds-container ggds-header__inner">
    <a class="ggds-header__identity" href="/">
      <span class="ggds-header__monogram" aria-hidden="true">EDC</span>
      <span class="ggds-header__text">
        <span class="ggds-header__name">Example Digital Centres</span>
        <span class="ggds-header__country">Republic of Ghana</span>
        <span class="ggds-visually-hidden"> – home</span>
      </span>
    </a>
    <nav class="ggds-header__nav" id="gdcl-nav" aria-label="Main">
      <ul class="ggds-header__list">
        <li><a class="ggds-header__link" href="/services/">Services</a></li>
        <li><a class="ggds-header__link" href="/regulation/">Laws &amp; regulations</a></li>
        <li><a class="ggds-header__link" href="/news-notices/">News &amp; notices</a></li>
        <li><a class="ggds-header__link" href="/about/">About &amp; contact</a></li>
      </ul>
    </nav>
    <a class="ggds-header__search" href="/search/"><svg class="ggds-header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg><span class="ggds-header__search-label">Search</span></a>
    <button type="button" class="ggds-header__menu-button" aria-controls="gdcl-nav" aria-expanded="false" hidden><svg class="ggds-header__icon ggds-header__icon--menu" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 6h16M4 12h16M4 18h16"/></svg><svg class="ggds-header__icon ggds-header__icon--close" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18"/></svg><span class="ggds-visually-hidden">Menu</span></button>
  </div>
</header>
</div>
JSX (React)
<div data-ggds-theme="gdcl">
<header className="ggds-header">
  <div className="ggds-container ggds-header__inner">
    <a className="ggds-header__identity" href="/">
      <span className="ggds-header__monogram" aria-hidden="true">EDC</span>
      <span className="ggds-header__text">
        <span className="ggds-header__name">Example Digital Centres</span>
        <span className="ggds-header__country">Republic of Ghana</span>
        <span className="ggds-visually-hidden"> – home</span>
      </span>
    </a>
    <nav className="ggds-header__nav" id="gdcl-nav" aria-label="Main">
      <ul className="ggds-header__list">
        <li><a className="ggds-header__link" href="/services/">Services</a></li>
        <li><a className="ggds-header__link" href="/regulation/">Laws &amp; regulations</a></li>
        <li><a className="ggds-header__link" href="/news-notices/">News &amp; notices</a></li>
        <li><a className="ggds-header__link" href="/about/">About &amp; contact</a></li>
      </ul>
    </nav>
    <a className="ggds-header__search" href="/search/"><svg className="ggds-header__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><circle cx="11" cy="11" r="7" /><path d="m20 20-3.5-3.5" /></svg><span className="ggds-header__search-label">Search</span></a>
    <button type="button" className="ggds-header__menu-button" aria-controls="gdcl-nav" aria-expanded="false" hidden><svg className="ggds-header__icon ggds-header__icon--menu" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><path d="M4 6h16M4 12h16M4 18h16" /></svg><svg className="ggds-header__icon ggds-header__icon--close" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6 6 18" /></svg><span className="ggds-visually-hidden">Menu</span></button>
  </div>
</header>
</div>

Use it

Stylesheet
ggds.css includes it. To load only the parts you use: core.css, then components/header.css (1.3 KB with gzip, minified).
JavaScript
Optional. With the GGDS script, below 80rem the sections go behind a menu button that opens the list in place and closes with Escape, returning focus to the button. Without it, the sections show as a list under the name.

HTML

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

Astro

With @ggds/astro:

JavaScript
import Header from '@ggds/astro/Header.astro';

<Header name="National Communications Authority" initials="NCA"
  nav={[{ label: 'Services', href: '/services/' }, { label: 'About', href: '/about/' }]}
  current={Astro.url.pathname} />

React and Next.js

With @ggds/react:

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

<Header name="Example Agency" initials="EA" current="/services/"
  nav={[{ label: 'Services', href: '/services/' }, { label: 'About', href: '/about/' }]} />

Django

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

Django template
{% ggds_header name="National Communications Authority" initials="NCA" nav=nav %}

Classes and states

Classes for header and main navigation
ClassWhat it does
.ggds-headerThe header. Sticky, white, with the flag colours as a thin line above and a line in the institution's colour below.
.ggds-header__innerThe row inside the page width.
.ggds-header__identityThe link home: logo or initials, name and country.
.ggds-header__logoAn approved logo, 44px, drawn round.
.ggds-header__monogramThe institution's initials in a round badge, until it has an approved logo.
.ggds-header__textThe name and country.
.ggds-header__nameThe institution's name, in its colour.
.ggds-header__name--longA name longer than 45 characters: set smaller on phones.
.ggds-header__country"Republic of Ghana" under the name, on wide screens.
.ggds-header__navThe main navigation.
.ggds-header__nav--collapsibleAdded by the GGDS script: the navigation can be hidden behind the menu button.
.ggds-header__listThe list of sections.
.ggds-header__linkA section link.
.ggds-header__searchThe link to the search page, with its icon.
.ggds-header__search-labelThe word "Search": shown on wide screens, otherwise kept for screen readers only.
.ggds-header__menu-buttonThe menu button. Has hidden until the GGDS script shows it.
.ggds-header__iconAn icon in the header.
.ggds-header__icon--menuThe menu icon, shown while the menu is closed.
.ggds-header__icon--closeThe close icon, shown while the menu is open.
States of header and main navigation
StateWhat it does
aria-current="page" on .ggds-header__linkThe section the visitor is in: marked with a line in the link colour, and underlined on wide screens.
aria-expanded="true" on .ggds-header__menu-buttonThe menu is open: the close icon shows.
hidden on .ggds-header__navThe menu is closed (set by the GGDS script).

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: “opens in place, closes with Escape and returns focus”
  • Behaviour test: “navigation is visible and the menu button is not”
  • Behaviour test: “one row from 80rem: name, navigation and Search side by side”
  • Behaviour test: “a menu button below 80rem”
  • Behaviour test: “the header row fits inside the page at 1280px and 1440px, even with six sections”

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 header and main navigation
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 header and main navigation, newest first
VersionChange
0.1.0Header, hero, footer and cards share one design: one-row header with the flag-colour line, woven flag band in the footer, institution cards with a line in each institution's colour.
0.1.0The phone menu pushes the page down instead of covering it, so keyboard users never land on content they cannot see.
0.1.0New: @ggds/astro, the page parts as Astro components (skip link, banner, header, hero, footer, tab bar).
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

  • Government website banner

    Tells people the website belongs to the Government of Ghana, and how to check.

  • Tab bar

    Home, up to three main sections and Search, fixed to the bottom of the screen on phones.

  • Footer

    Who runs the website, how to contact them, the main sections and the links every government website must have.

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.