unscripted/ui

Accordion

Exclusive open, animated height auto, correct semantics, find-in-page support. The browser does all of it.

details-contentinterpolate-size

How it works

  • <details name="acc-faq"> makes the group exclusive — the browser closes the other panels.
  • details-content:h-0open:details-content:h-auto animates the panel height. The trick that makes height: auto animatable is [interpolate-size:allow-keywords] on the wrapper — it’s an inherited property, so one wrapper class covers every panel and the snippet is fully self-contained (nothing to add to your CSS config).
  • details-content:transition-discrete (transition-behavior: allow-discrete) keeps the content painted (content-visibility) while it collapses, so the close animation is visible too.
  • The chevron is a after: pseudo-element rotated with group-open:.

Accessibility

<details>/<summary> ship keyboard support and disclosure semantics natively, and unlike display: none accordions, collapsed content is still searchable with find-in-page in Chromium (content-visibility: hidden keeps it in the DOM).

Browser support

Minimum stable version per engine, resolved at build time from MDN's browser-compat-data; Baseline status from the official web-features dataset. Everything degrades gracefully — the “when missing” column is the actual behavior, not a broken page.

FeatureChromeEdgeFirefoxSafariWhen missing
Exclusive accordions (<details name>)Baseline 2024 · newly available12012013017.2All panels can be open at the same time — still fully functional.
::details-content pseudo-elementBaseline 2025 · newly available13113114318.4Panels open and close instantly, without the height animation.
interpolate-size: allow-keywordsLimited availability129129height: auto cannot be interpolated, so content snaps open instead of easing.

‡ HTML feature — @supports can only test CSS, and we ship no JS to detect it, so it gets no live badge.