Expand / Collapse Widget Examples

Each widget is wrapped in a div.example. The controlled content container uses the class "details". Buttons use aria-expanded + aria-controls for accessibility.

Simple Toggle
Shows basic expand / collapse behavior
Animated Panel (Height transition)
Nice animation for content with variable height
Accordion Group
Only one panel opens at a time in this group