Transition Details

Animate the height of a native disclosure when it opens or closes. The browser handles pointer and keyboard interaction.

Build output

Compiled 24 modules. All tests passed.

Usage

Add transition-details to the <details> itself. The summary stays visible throughout the transition.

<details class="transition-details">
  <summary>Build output</summary>
  <p>Compiled 24 modules. All tests passed.</p>
</details>

To use the same behavior from a Tailwind stylesheet after importing Basecoat:

.build-output {
  @apply transition-details;
}

Where Basecoat uses it

Accordion items and Sidebar submenus also fade the panel. Trace animates the panel height and turns its chevron. All three apply the utility internally.

Ordinary disclosures, including Collapsible, open instantly by default. Reduced motion disables the transition. Browsers without support for native disclosure height animation still open and close the content.