Skip to content
design system
Thème d’affichage, actuellement Auto

molecule · stable · since 2026-09

Accordion

Purpose

A list of disclosures under their headings, each independent by default: opening one closes no other, because closing what the reader had just opened surprises them. The items are data and the panel is a snippet, so the caller writes the content once and the component holds which are open.

When to use, when not

Use it for a list of questions and answers, a list of criteria with their explanation, any set of details the reader may skip. Do not use it for views of equal weight the user switches between (Tabs), nor for one panel alone (Disclosure).

Anatomy

  1. One Disclosure per item: a heading with the button, and the panel.

Props

Props of Accordion
NameTypeDefaultWhat it does
itemsItem[]The panels, in order.
level?2 | 3 | 4 | 5 | 63The heading level of every title.
open?string[][]The ids of the panels open at first.
exclusive?booleanfalseOpening a panel closes the others. Off by default: independent panels surprise nobody.
class?string''Layout classes only.
panelSnippet<[Item]>The content of one panel, given its item.

States

Independent, exclusive, and with a panel open at first.

exclusive

Opening a panel closes the others, for a caller that asked for it.

Light

Dark

320 px, light

320 px, dark

216 px, light

Forced colours, captured
Accordion, story exclusive, as Chromium renders it with forced colours active

independent

Each panel opens and closes on its own; two can be open to compare them.

Light

Dark

320 px, light

320 px, dark

216 px, light

Forced colours, captured
Accordion, story independent, as Chromium renders it with forced colours active

preset

The second panel is open at first render.

Light

Non. Les critères non applicables sont exclus du calcul : le taux rapporte les critères conformes au nombre de critères réellement applicables.

Dark

Non. Les critères non applicables sont exclus du calcul : le taux rapporte les critères conformes au nombre de critères réellement applicables.

320 px, light

Non. Les critères non applicables sont exclus du calcul : le taux rapporte les critères conformes au nombre de critères réellement applicables.

320 px, dark

Non. Les critères non applicables sont exclus du calcul : le taux rapporte les critères conformes au nombre de critères réellement applicables.

216 px, light

Non. Les critères non applicables sont exclus du calcul : le taux rapporte les critères conformes au nombre de critères réellement applicables.

Forced colours, captured
Accordion, story preset, as Chromium renders it with forced colours active

Accessibility contract

  • Role and name: Disclosure’s, per panel.
  • Keyboard, focus: Tab moves from button to button and into an open panel’s content; Enter and Space toggle. No arrow-key navigation: the panels are headings and buttons, and both already have their keys.
  • Live regions: none.

Content rules

French. Titles are questions or noun phrases, each different from the others so the list of headings reads on its own.

Do and don’t

  • Do give level the level the titles hold in the page.
  • Do not set exclusive unless the panels really are alternatives; it costs a screen reader user the panel they opened to compare.

Examples

<Accordion items={questions} level={3}>
	{#snippet panel(item)}<p>{answers[item.id]}</p>{/snippet}
</Accordion>

Surfaces

  • App: the questions of the help page and the criteria of the report; not ported yet.
  • Site: the questions of the pricing page, once the site is ported.

Related

Disclosure, Tabs.

Decisions

  • 2026-09-24: independent by default, exclusive on request, as the site’s accordéon demo argues.

Criteria held by construction

  • 7.1, Chaque script est-il, si nécessaire, compatible avec les technologies d'assistance ?
    Each panel is a Disclosure: a native button with aria-expanded and aria-controls, the state and the relation assistive technology already knows.
  • 9.1, Dans chaque page web, l'information est-elle structurée par l'utilisation appropriée de titres ?
    Every title is a heading at the level the page gives, so the set reads as a list of sections in the outline.
  • 12.8, Dans chaque page web, l'ordre de tabulation est-il cohérent ?
    A folded panel carries hidden and its content leaves the tab order, whatever the number of panels.

Tokens it reads

None of its own: the component draws with the base layer alone.