This widget uses the native HTML details/summary elements. Click the title to expand or collapse the content.
This widget uses a button-like div with ARIA attributes to expand/collapse the content via JavaScript.
Content is placed inside a div with class "details" to mark the controlled region.
Content for item 1. This panel is shown when the checkbox is checked.
Content for item 2. This demonstrates a simple CSS-only approach using checkboxes.