Expand / Collapse Widget

Simple details (collapsed) Click to reveal content
Expanded by default Shows the open state on load

This example initializes in the expanded state. JavaScript inspects the button's aria-expanded attribute on load to determine whether to reveal the content.

  • Accessible: uses aria-expanded and aria-controls
  • Smooth: uses max-height transition for animation
  • Responsive: supports keyboard interaction