Three variations of expand/collapse: native details/summary, a basic custom toggle, and an animated custom toggle. Each widget is wrapped in a div with class "example". The controlled content container uses class "details".
Uses the built-in HTML details element for accessibility and minimal scripting.
Note: The details element provides keyboard and screen reader support natively.
A button toggles a content container using the hidden attribute and ARIA states.
Animated expansion using CSS grid row transitions. The content container remains in the DOM to allow smooth animation.