Expand/Collapse Widgets Demo

Native details/summary widget

This widget uses the native HTML details/summary elements. Click the title to expand or collapse the content.

  • Accessible by default with built-in keyboard support
  • Content is wrapped in a div with class "details"

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.