Group disclosures together with exclusive (accordion) or non-exclusive (multi-open) behavior.
Uses data-disclosure-group for automatic initialization.
A lightweight, framework-agnostic library for animated disclosure components. It provides smooth height transitions for native <details> elements using the Web Animations API.
Yes. It uses native <details>/<summary> elements, respects prefers-reduced-motion, supports keyboard navigation (Tab + Enter/Space), and includes focus-visible styles.
All modern browsers that support the Web Animations API: Chrome, Firefox, Safari, and Edge.
Zero dependencies. It is pure TypeScript/JavaScript with CSS. The IIFE build is a single file you can load via a <script> tag.
Absolutely. The core library is framework-agnostic. Framework-specific wrappers (like shadcn-disclosures for React) can be built on top of the CSS and JS primitives.
data-disclosure-group="false".Via npm: npm install @disclosures/core, or load the IIFE build directly from a CDN with a <script> tag.
Override the CSS custom properties --disclosure-duration and --disclosure-easing, or pass options to new AnimatedDetails(el, { duration: 500, easing: 'ease-out' }).
The library uses BEM classes (.disclosure, .disclosure__summary, etc.) and CSS custom properties. You can override any token or add your own variant classes.
data-disclosure-group (or data-disclosure-group="true") creates an accordion where only one item is open at a time.
data-disclosure-group="false" allows multiple items to be open simultaneously.
data-disclosure-group.<!-- Exclusive (accordion) -->
<div data-disclosure-group>
<details class="disclosure disclosure--faq disclosure--indicator-plus" data-animated>
<summary class="disclosure__summary">
<span class="disclosure__indicator" aria-hidden="true"></span>
<span class="disclosure__label">Question 1</span>
</summary>
<div class="disclosure__content">
<div class="disclosure__content-inner">Answer 1</div>
</div>
</details>
<!-- more items... -->
</div>
<!-- Non-exclusive (multi-open) -->
<div data-disclosure-group="false">
<!-- same markup -->
</div>