Expand/Collapse Widgets

Examples include a native HTML disclosure, a custom button-controlled panel, and a basic accordion. Each controlled content container uses the class details.

Example 1: Native HTML
Project Overview

This section uses the native HTML <details> element with a <summary> trigger. It provides built-in accessibility and keyboard support.

  • Keyboard toggle with Enter or Space on the summary
  • Built-in open/close state via the open attribute
  • Minimal scripting required
Example 2: Custom Disclosure Button
Example 3: Accordion

Only one section opens at a time.