Page structure
Government website banner
Tells people the website belongs to the Government of Ghana, and how to check.
When to use
- On every page of a government website, before the header.
- On test, preview and copied versions of a site, use the "not official" version (
ggds-banner--unofficial).
When not to use
- On websites that are not run by a government institution.
How to use
- Put your website's real address in "Check the address".
- Link "register of official government websites" to the official list, when one is available.
- The wording "An official website of the Government of Ghana" is still waiting for approval, including for state-owned companies.
Do
- Name your website's real address.
Don't
- Say that every government website ends in .gov.gh. Some official websites do not.
Accessibility
What GGDS does
- It is built on
<details>, so it opens and closes with the keyboard and a screen reader, without JavaScript. - The flag is decoration: it is drawn in CSS and has no text for screen readers.
- It scrolls away with the page, so it takes no space on small screens.
What you need to do
- Name your real address in "Check the address", so people can compare it with the address bar.
- Keep the wording as published: people learn to recognise it.
Example: Official site
<section class="ggds-banner" aria-label="Official government website">
<details class="ggds-banner__details ggds-container">
<summary class="ggds-banner__summary">
<svg class="ggds-banner__flag" viewBox="0 0 30 20" aria-hidden="true" focusable="false">
<rect class="ggds-banner__flag-red" width="30" height="6.67"/>
<rect class="ggds-banner__flag-gold" y="6.67" width="30" height="6.67"/>
<rect class="ggds-banner__flag-green" y="13.33" width="30" height="6.67"/>
<polygon class="ggds-banner__flag-star" points="15,6.8 15.73,8.99 18.04,9.01 16.19,10.39 16.88,12.59 15,11.25 13.12,12.59 13.81,10.39 11.96,9.01 14.27,8.99"/>
</svg>
<span class="ggds-banner__text">An official website of the Government of Ghana</span>
<span class="ggds-banner__toggle">How to tell</span>
</summary>
<div class="ggds-banner__content">
<div class="ggds-banner__item">
<p class="ggds-banner__heading">Check the address</p>
<p>The official address of this website is <strong>www.example.gov.gh</strong>. Most government websites end in <strong>.gov.gh</strong>, but some official websites do not. You can check it in the <a href="../../register.html">register of official government websites</a>.</p>
</div>
<div class="ggds-banner__item">
<p class="ggds-banner__heading">A padlock is not proof</p>
<p>A padlock or <strong>https://</strong> before the address means your connection to the website is private. It does not show who runs the website.</p>
</div>
<div class="ggds-banner__item">
<p class="ggds-banner__heading">We will never ask for your PIN</p>
<p>Government officials will never ask for your PIN, password or mobile money code, by phone, by SMS or on a website.</p>
</div>
</div>
</details>
</section><section className="ggds-banner" aria-label="Official government website">
<details className="ggds-banner__details ggds-container">
<summary className="ggds-banner__summary">
<svg className="ggds-banner__flag" viewBox="0 0 30 20" aria-hidden="true" focusable="false">
<rect className="ggds-banner__flag-red" width="30" height="6.67" />
<rect className="ggds-banner__flag-gold" y="6.67" width="30" height="6.67" />
<rect className="ggds-banner__flag-green" y="13.33" width="30" height="6.67" />
<polygon className="ggds-banner__flag-star" points="15,6.8 15.73,8.99 18.04,9.01 16.19,10.39 16.88,12.59 15,11.25 13.12,12.59 13.81,10.39 11.96,9.01 14.27,8.99" />
</svg>
<span className="ggds-banner__text">An official website of the Government of Ghana</span>
<span className="ggds-banner__toggle">How to tell</span>
</summary>
<div className="ggds-banner__content">
<div className="ggds-banner__item">
<p className="ggds-banner__heading">Check the address</p>
<p>The official address of this website is <strong>www.example.gov.gh</strong>. Most government websites end in <strong>.gov.gh</strong>, but some official websites do not. You can check it in the <a href="../../register.html">register of official government websites</a>.</p>
</div>
<div className="ggds-banner__item">
<p className="ggds-banner__heading">A padlock is not proof</p>
<p>A padlock or <strong>https://</strong> before the address means your connection to the website is private. It does not show who runs the website.</p>
</div>
<div className="ggds-banner__item">
<p className="ggds-banner__heading">We will never ask for your PIN</p>
<p>Government officials will never ask for your PIN, password or mobile money code, by phone, by SMS or on a website.</p>
</div>
</div>
</details>
</section>Example: Unofficial copy (staging, preview, mirror)
<section class="ggds-banner ggds-banner--unofficial" aria-label="Official government website">
<details class="ggds-banner__details ggds-container">
<summary class="ggds-banner__summary">
<svg class="ggds-banner__flag" viewBox="0 0 30 20" aria-hidden="true" focusable="false">
<rect class="ggds-banner__flag-red" width="30" height="6.67"/>
<rect class="ggds-banner__flag-gold" y="6.67" width="30" height="6.67"/>
<rect class="ggds-banner__flag-green" y="13.33" width="30" height="6.67"/>
<polygon class="ggds-banner__flag-star" points="15,6.8 15.73,8.99 18.04,9.01 16.19,10.39 16.88,12.59 15,11.25 13.12,12.59 13.81,10.39 11.96,9.01 14.27,8.99"/>
</svg>
<span class="ggds-banner__text">This copy is not the official Example Agency website</span>
<span class="ggds-banner__toggle">How to tell</span>
</summary>
<div class="ggds-banner__content">
<div class="ggds-banner__item">
<p class="ggds-banner__heading">Check the address</p>
<p>The official Example Agency website is <strong>www.example.gov.gh</strong>. Most government websites end in <strong>.gov.gh</strong>, but some official websites do not. You can check it in the <a href="../../register.html">register of official government websites</a>.</p>
</div>
<div class="ggds-banner__item">
<p class="ggds-banner__heading">A padlock is not proof</p>
<p>A padlock or <strong>https://</strong> before the address means your connection to the website is private. It does not show who runs the website.</p>
</div>
<div class="ggds-banner__item">
<p class="ggds-banner__heading">We will never ask for your PIN</p>
<p>Government officials will never ask for your PIN, password or mobile money code, by phone, by SMS or on a website.</p>
</div>
</div>
</details>
</section><section className="ggds-banner ggds-banner--unofficial" aria-label="Official government website">
<details className="ggds-banner__details ggds-container">
<summary className="ggds-banner__summary">
<svg className="ggds-banner__flag" viewBox="0 0 30 20" aria-hidden="true" focusable="false">
<rect className="ggds-banner__flag-red" width="30" height="6.67" />
<rect className="ggds-banner__flag-gold" y="6.67" width="30" height="6.67" />
<rect className="ggds-banner__flag-green" y="13.33" width="30" height="6.67" />
<polygon className="ggds-banner__flag-star" points="15,6.8 15.73,8.99 18.04,9.01 16.19,10.39 16.88,12.59 15,11.25 13.12,12.59 13.81,10.39 11.96,9.01 14.27,8.99" />
</svg>
<span className="ggds-banner__text">This copy is not the official Example Agency website</span>
<span className="ggds-banner__toggle">How to tell</span>
</summary>
<div className="ggds-banner__content">
<div className="ggds-banner__item">
<p className="ggds-banner__heading">Check the address</p>
<p>The official Example Agency website is <strong>www.example.gov.gh</strong>. Most government websites end in <strong>.gov.gh</strong>, but some official websites do not. You can check it in the <a href="../../register.html">register of official government websites</a>.</p>
</div>
<div className="ggds-banner__item">
<p className="ggds-banner__heading">A padlock is not proof</p>
<p>A padlock or <strong>https://</strong> before the address means your connection to the website is private. It does not show who runs the website.</p>
</div>
<div className="ggds-banner__item">
<p className="ggds-banner__heading">We will never ask for your PIN</p>
<p>Government officials will never ask for your PIN, password or mobile money code, by phone, by SMS or on a website.</p>
</div>
</div>
</details>
</section>Use it
- Stylesheet
ggds.cssincludes it. To load only the parts you use:core.css, thencomponents/banner.css(0.7 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 Banner from '@ggds/astro/Banner.astro';
<Banner official shortName="NCA" host="nca.org.gh" />React and Next.js
With @ggds/react:
import { Banner } from '@ggds/react';
<Banner shortName="Example Agency" host="www.example.gov.gh" official />Django
With ggds-django ({% load ggds %}):
{% ggds_banner short_name="NCA" host="nca.org.gh" official=True %}Classes and states
| Class | What it does |
|---|---|
.ggds-banner | The banner: a strip above the header. |
.ggds-banner--unofficial | For a website not served from its official address: says so and names the real one. |
.ggds-banner__details | The <details> element that opens and closes the explanation. |
.ggds-banner__summary | The always-visible line: the flag, the sentence and the toggle. |
.ggds-banner__flag | The small Ghana flag, drawn in CSS. |
.ggds-banner__flag-red | The flag's red stripe. |
.ggds-banner__flag-gold | The flag's gold stripe. |
.ggds-banner__flag-green | The flag's green stripe. |
.ggds-banner__flag-star | The flag's black star. |
.ggds-banner__text | The sentence "An official website of the Government of Ghana". |
.ggds-banner__toggle | "Here's how you know", with an arrow that turns when the banner is open. |
.ggds-banner__content | The explanation shown when open: two items side by side from 48rem. |
.ggds-banner__item | One item of the explanation. |
.ggds-banner__heading | An item's heading. |
| State | What it does |
|---|---|
[open] on .ggds-banner__details | Open: the explanation shows and the arrow points up. |
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: “the identification banner opens”
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 | React and Astro: the banner's register link and the hero's search label now default to GGDS's own words, so you no longer have to pass them. React has errorTitle() for the page title while a form has errors. |
| 0.1.0 | New: @ggds/astro, the page parts as Astro components (skip link, banner, header, hero, footer, tab bar). |
| 0.1.0 | New: 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.0 | Added. |
Related components
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.