Skip to content

Official government website An official website of the Federal Government of Nigeria

How you know
Federal Ministry of Communications, Innovation & Digital Economy Nigerian Design Standards

Accordion

A list of headers that each open and close a panel of related content, so people can scan a long page and open only what they need.

Updated

Live example

Accordion

Register with the Corporate Affairs Commission online. It takes about 3 days.
Controls
Property Control What it does
Closed, hover, focused or open
Says what is inside
What is inside, short

Overview

Use an accordion when content falls into short, parallel sections and most people only need one or two of them. Headers stay visible; each opens its own panel, and several can be open at once.

Use an accordion for

  • Many short answers people scan, like an FAQ
  • Optional details most people can skip
  • Grouping related sections on a long page

Don’t use an accordion for

  • Content everyone needs to read (use headings)
  • Views of equal weight people switch between (use tabs)
  • Steps done in order, or legal and critical information

States

One header in four states. Hover and focused keep the closed layout; open shows the content.

Closed

The default. Header text and a plus icon.

Hover

surface/muted behind the header.

Focused

Keyboard focus: a 3px border/focus ring with a 1px gap.

Register with the Corporate Affairs Commission online. It takes about 3 days.

Open

A minus icon and the content panel on surface/subtle.

Specifications

The properties of the accordion. The same in HTML, WordPress and React.

Accordion properties
Property Type Possible values Description
title string any text Required. Says what is inside, as a question or a short phrase.
open boolean
  • false default
  • true
Whether the panel starts open.
content string any text Required. Keep it short and link out for long content.
headingLevel number 2 to 6 Defaults to 3. Follow the page outline.

In code, the header is a <button type="button"> with aria-expanded and aria-controls, inside a heading that fits the page outline. The panel uses hidden when closed. People can open more than one panel; don’t close the others automatically.

Tokens

Accordion tokens and contrast
Part Token Contrast on the page
Container surface/canvas · border/subtle · 1px · radius/050 · spacing/150 · 12px Border is decorative
Expand icon (20px) icon/Plus Small · icon/Minus Small · text/secondary 6.6:1
Header text Label/medium · text/primary 17.6:1
Hover surface/muted behind the header 16.4:1 (text)
Focus ring border/focus, 3px, with a 1px surface/canvas gap 4.5:1
Open panel surface/subtle · Body/small · text/secondary · spacing/100 · 8px under the header 6.4:1

Use cases

Do

Fees depend on the business type.

About 3 working days.

Use an accordion for many short, parallel sections people scan, like an FAQ.

Don’t

By applying you agree to the data use terms. Fees are not refundable.

Don’t hide what everyone must read, like terms or deadlines. Show it on the page.

Layout

How accordions sit on a page.

Fills the column
The same width as the content around it, on every screen.
8px between items
spacing/100, so a group reads as one set.
12px inside the header
spacing/150 on every side, with the icon at the far edge.
48px header
Well above the 24px minimum target.
Several can be open
Don’t close the others when one opens.

Copywriting

How to write headers and panels.

Short headers
A few words that say what is inside.
Questions for FAQs
“How do I register a business?”
Front-load the keyword

“Fees for registration”, not “Information about the fees”.

Keep panels short

A few sentences or a list. Link out for the rest.

No instructions

Don’t write “Click to expand”. The icon and state say it.

One style per group
All questions, or all short phrases.

Examples

Accordion copywriting examples
Write Don’t write Why
How do I register a business? Business registration information A question people ask.
Fees and payment Click here to see fees Says what is inside.
Documents you need More information Specific.
Who can apply WHO CAN APPLY Sentence case.
Opening hours Hours of operation (expand) No instructions in the header.

Accessibility

The header is a button that says whether its panel is open. Colour and icon are never the only signal.

Keyboard interaction for accordions
Key What it does
Tab Moves to the next header. Links in open panels are reached in reading order.
Shift+Tab Moves back.
Enter or Space Opens or closes the panel.
  • The header is a button inside a heading, with aria-expanded and aria-controls (WCAG 4.1.2, 1.3.1).
  • Closed panels use hidden, so their content is skipped until opened (WCAG 1.3.2).
  • The state is in aria-expanded, not only the plus or minus icon (WCAG 1.4.1).
  • The 3px focus ring is 4.5:1 and stays on the header after toggling (WCAG 2.4.7, 1.4.11).
  • The header is 48px tall, above the 24px minimum (WCAG 2.5.8).

For developers

Copy the code for HTML, WordPress or React from the Code tab in Live example. The options are listed under Specifications.

For designers

Use Accordion from 01 Library – Foundations, or Grouped accordion for a set. Pick the state and edit the Title and Content. Don’t detach it.

References

Feedback

Report a problem with this page