Skip to main content
  1. Docs
  2. Components
  3. Navigation

Accordion

Sections that fold, ruled between. Each title is a heading and a button.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<h3><button>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

When to use

Use it for
  • Questions and answers.
  • Settings grouped by topic, read one at a time.
  • Long detail most people skip.
Not for
  • One section: Show more, AdvancedCollapsible
  • Views to switch betweenTabs
  • Content everyone needsCard

02

Anatomy

  1. 1accordion-item<div>One section, ruled from the next.
  2. 2accordion-header<h3>The heading, at headingLevel.
  3. 3accordion-trigger<button>The title, full width: aria-expanded.
  4. 4chevron<svg>Turns as the section opens.
  5. 5accordion-panel<div role="region">The content.

03

Do and don't

Titles that say what's inside
DoA question or a topic: read without opening.
Don'tVague titles: every section must be opened to find anything.
Not for what everyone needs
DoDetail most people skip, folded.
Don'tThe one field everyone must fill, hidden in a fold.

04

Content

  • Titles in sentence case: a question, or a topic in a few words.
  • No full stop, unless it's a question.
  • Keep each section short; a long one wants its own page.
Next — AccordionAPI