Expand/Collapse Widgets

Examples of native and custom disclosure patterns. Each controlled content container uses the "details" class.

Native HTML details/summary

Uses the built-in <details> element with a details class on the container.

What is included in this package?
  • Core library files
  • TypeScript definitions new
  • Detailed documentation and examples

Tip: The native element manages focus, toggle state, and accessibility automatically.

Custom disclosure button

A button toggles visibility of a sibling container with the details class.

Accordion (one section open at a time)

Each section has a button that controls a corresponding container with the details class.