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

Content

Disclosure and accordion

Sections people can open and close, such as questions and answers.

When to use

  • For extra detail that only some people need, such as "What if I do not have a Ghana Card?".
  • For a list of questions and answers, where each person looks for one or two. Use an accordion.

When not to use

  • For information everyone needs, such as fees, deadlines or required documents. Put it on the page.
  • For short content. Showing it is quicker than opening it.
  • For steps people must follow in order. Use a numbered list.
  • To switch between views, like tabs. Use headings on one page, or separate pages with tab links.

How to use

  • Build each section from <details class="ggds-disclosure">, a <summary class="ggds-disclosure__summary"> and a ggds-disclosure__content block.
  • For several sections, put them in a ggds-accordion. It adds lines between them.
  • Write each summary as the question or topic people are looking for, in under ten words.
  • Start sections closed. Add open only when most people need that one.
  • Put only plain text in the summary: no links, buttons or headings.
  • Do not put a disclosure inside another one.

Do

  • Use the words people search for: "How do I pay?".

Don't

  • Hide the fee or the deadline in a closed section.
  • Write vague summaries such as "More information".

Accessibility

What GGDS does

  • Built on the browser's own <details>: it opens with Enter or Space, screen readers announce whether it is open, and it works without JavaScript.
  • The summary is at least 44px tall, bold and in the link colour, with the gold focus ring.
  • The arrow is drawn in CSS: it points down when closed and up when open.

What you need to do

  • Keep <details> and <summary>. Do not rebuild it with <div>s and a script.
  • Write each summary so it makes sense on its own.
  • Do not hide information everyone needs inside a closed section.

Example: Accordion of questions

Open this example on its own page

HTML code for “Accordion of questions”
HTML
<div class="ggds-accordion">
  <details class="ggds-disclosure">
    <summary class="ggds-disclosure__summary">How long does a licence take?</summary>
    <div class="ggds-disclosure__content"><p>Most applications are decided within 30 working days of a complete application.</p></div>
  </details>
  <details class="ggds-disclosure">
    <summary class="ggds-disclosure__summary">Can I apply on behalf of someone else?</summary>
    <div class="ggds-disclosure__content"><p>Yes, with a letter of authorisation signed by the applicant.</p></div>
  </details>
  <details class="ggds-disclosure">
    <summary class="ggds-disclosure__summary">How do I pay?</summary>
    <div class="ggds-disclosure__content"><p>Online by card or mobile money, or at our offices.</p></div>
  </details>
</div>
JSX (React)
<div className="ggds-accordion">
  <details className="ggds-disclosure">
    <summary className="ggds-disclosure__summary">How long does a licence take?</summary>
    <div className="ggds-disclosure__content"><p>Most applications are decided within 30 working days of a complete application.</p></div>
  </details>
  <details className="ggds-disclosure">
    <summary className="ggds-disclosure__summary">Can I apply on behalf of someone else?</summary>
    <div className="ggds-disclosure__content"><p>Yes, with a letter of authorisation signed by the applicant.</p></div>
  </details>
  <details className="ggds-disclosure">
    <summary className="ggds-disclosure__summary">How do I pay?</summary>
    <div className="ggds-disclosure__content"><p>Online by card or mobile money, or at our offices.</p></div>
  </details>
</div>

Example: States: closed and open

Open this example on its own page

HTML code for “States: closed and open”
HTML
<details class="ggds-disclosure">
  <summary class="ggds-disclosure__summary">Closed: what documents do I need?</summary>
  <div class="ggds-disclosure__content"><p>Your Ghana Card and proof of address.</p></div>
</details>
<details class="ggds-disclosure" open>
  <summary class="ggds-disclosure__summary">Open: how much does it cost?</summary>
  <div class="ggds-disclosure__content"><p>GH₵ 50, paid online or at our offices.</p></div>
</details>
JSX (React)
<>
  <details className="ggds-disclosure">
    <summary className="ggds-disclosure__summary">Closed: what documents do I need?</summary>
    <div className="ggds-disclosure__content"><p>Your Ghana Card and proof of address.</p></div>
  </details>
  <details className="ggds-disclosure" open>
    <summary className="ggds-disclosure__summary">Open: how much does it cost?</summary>
    <div className="ggds-disclosure__content"><p>GH₵ 50, paid online or at our offices.</p></div>
  </details>
</>

Use it

Stylesheet
ggds.css includes it. To load only the parts you use: core.css, then components/disclosure.css (0.5 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

No React component: switch the HTML under an example to JSX (React) and copy it.

Django

No template tag: copy the HTML into your template.

Classes and states

Classes for disclosure and accordion
ClassWhat it does
.ggds-disclosureOne section that opens and closes: a <details> element.
.ggds-disclosure__summaryThe heading people click, with an arrow.
.ggds-disclosure__contentWhat shows when it is open.
.ggds-accordionSeveral disclosures as one list, with lines between them.
States of disclosure and accordion
StateWhat it does
[open]Open: the content 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

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 disclosure and accordion
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 disclosure and accordion, newest first
VersionChange
0.2.0Fuller guidance for tags, breadcrumbs, disclosures, the skip link, pagination, rich text, tables and tab links.
0.1.0Added.

Every change, in What’s new

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.