Each widget is wrapped with a container having class="example". The controlled content container uses class="details".
This uses the built-in browser widget. The content container below has class="details".
The native <details> element provides expand/collapse functionality without custom scripting. Use it when you want a simple, accessible disclosure. Styling is limited by the browser, but it's robust.
A simple accessible widget controlled by a button. The content container uses class="details".
A slightly more advanced widget that animates the height for a smooth transition. The container has class="details".