Content
Notice
A message box for information, success, a warning or danger, and an urgent notice for the whole site.
When to use
- For something people must notice on this page.
- The urgent notice: for something that affects everyone right now, such as a service outage.
When not to use
- For form errors. Use the error summary.
- For every paragraph. If everything stands out, nothing does.
How to use
- Pick the type that fits: information, success, warning or danger.
- Keep it short. Say what happened and what to do next.
Accessibility
What GGDS does
- Each type has its own colour and a thick edge, and every type's text colour is measured against its background every time GGDS is built.
What you need to do
- Start each notice with a word that says its type, such as "Warning:". It can be hidden on screen, but the meaning must never depend on colour alone.
- Use
role="alert"only for a notice that appears after the page has loaded.
Example: Notice types
<div class="ggds-notice">
<p class="ggds-notice__title"><span class="ggds-visually-hidden">Information:</span> Offices close at 3pm on Friday</p>
<p>Online services stay open.</p>
</div>
<div class="ggds-notice ggds-notice--success">
<p class="ggds-notice__title"><span class="ggds-visually-hidden">Success:</span> Application sent</p>
<p>Your reference number is <strong>LIC-2026-004512</strong>.</p>
</div>
<div class="ggds-notice ggds-notice--warning">
<p class="ggds-notice__title"><span class="ggds-visually-hidden">Warning:</span> This fee has not been confirmed</p>
<p>Contact us before you pay.</p>
</div>
<div class="ggds-notice ggds-notice--danger">
<p class="ggds-notice__title"><span class="ggds-visually-hidden">Important:</span> Beware of fake recruitment adverts</p>
<p>We never charge a fee to apply for a job.</p>
</div><>
<div className="ggds-notice">
<p className="ggds-notice__title"><span className="ggds-visually-hidden">Information:</span> Offices close at 3pm on Friday</p>
<p>Online services stay open.</p>
</div>
<div className="ggds-notice ggds-notice--success">
<p className="ggds-notice__title"><span className="ggds-visually-hidden">Success:</span> Application sent</p>
<p>Your reference number is <strong>LIC-2026-004512</strong>.</p>
</div>
<div className="ggds-notice ggds-notice--warning">
<p className="ggds-notice__title"><span className="ggds-visually-hidden">Warning:</span> This fee has not been confirmed</p>
<p>Contact us before you pay.</p>
</div>
<div className="ggds-notice ggds-notice--danger">
<p className="ggds-notice__title"><span className="ggds-visually-hidden">Important:</span> Beware of fake recruitment adverts</p>
<p>We never charge a fee to apply for a job.</p>
</div>
</>Example: Urgent site-wide notice
<div class="ggds-notice ggds-notice--urgent" role="region" aria-label="Urgent notice">
<div class="ggds-container">
<p class="ggds-notice__title">Flood warning for the Greater Accra Region until 6pm today. <a href="/warnings/">Read what to do</a></p>
</div>
</div><div className="ggds-notice ggds-notice--urgent" role="region" aria-label="Urgent notice">
<div className="ggds-container">
<p className="ggds-notice__title">Flood warning for the Greater Accra Region until 6pm today. <a href="/warnings/">Read what to do</a></p>
</div>
</div>Use it
- Stylesheet
ggds.cssincludes it. To load only the parts you use:core.css, thencomponents/notice.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:
import { Notice } from '@ggds/react';
<Notice type="warning" title="This fee has not been confirmed">
<p>Contact us before you pay.</p>
</Notice>Django
No template tag: copy the HTML into your template.
Classes and states
| Class | What it does |
|---|---|
.ggds-notice | An information notice. |
.ggds-notice--success | Something worked. |
.ggds-notice--warning | Something people need to know before they continue. |
.ggds-notice--danger | Something is wrong or risky. |
.ggds-notice--urgent | A site-wide notice under the header, such as an emergency. |
.ggds-notice__title | The notice's first line, starting with its type (which can be visually hidden). |
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.
| 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
Added in version 0.1.0. No changes since.
Related components
Something wrong, unclear or missing? or suggest a change to it on GitHub. You need a GitHub account.