Expand/Collapse Widgets

Examples of collapsible sections using native and custom controls. Each widget is wrapped in a div with class "example", and the container for controlled content uses class "details".

Project Overview

This section uses the native HTML details/summary elements, which provide built-in expand/collapse behavior and accessibility. Click the summary to toggle visibility.

  • Zero JavaScript needed
  • Keyboard and screen-reader friendly by default
  • Easy to style