Skip navigation

Components / UI & forms

Accordion

Native disclosures with reversible height motion and animated plus/minus strokes.

div.accordion > details > summary + div.accordion-body
Try it
How does this open?

Native disclosure with reversible height motion. Paragraphs use the same spacing as the rest of the framework.

With reduced motion or no JavaScript, the answer is still available.

Can more than one stay open?

Native disclosure with reversible height motion. Paragraphs use the same spacing as the rest of the framework.

With reduced motion or no JavaScript, the answer is still available.

What happens without JavaScript?

Native disclosure with reversible height motion. Paragraphs use the same spacing as the rest of the framework.

With reduced motion or no JavaScript, the answer is still available.

<div class="accordion"><details><summary>How does this open?</summary><div class="accordion-body content"><p>Native disclosure with reversible height motion. Paragraphs use the same spacing as the rest of the framework.</p><p>With reduced motion or no JavaScript, the answer is still available.</p></div></details><details><summary>Can more than one stay open?</summary><div class="accordion-body content"><p>Native disclosure with reversible height motion. Paragraphs use the same spacing as the rest of the framework.</p><p>With reduced motion or no JavaScript, the answer is still available.</p></div></details><details><summary>What happens without JavaScript?</summary><div class="accordion-body content"><p>Native disclosure with reversible height motion. Paragraphs use the same spacing as the rest of the framework.</p><p>With reduced motion or no JavaScript, the answer is still available.</p></div></details></div>
Class or attributeWhat it does
openNative initial expanded state.
--accordion-title-sizeDisclosure title size defaults to H4 (24px), independently of the answer text.
multiple open itemsDefault behavior; opening one does not close another.
reduced motion / no jsImmediate native disclosure.
within is-darkDividers use a quieter version of the dark border color.