Expand / Collapse widget examples

Two accessible patterns for expand/collapse content. Each widget is wrapped with a div.example and the controlled panel uses a container with the class "details". Use the keyboard (Tab and Enter/Space) to operate. Press Escape to close an open panel.

Simple toggle

Interactive panel


Notes on keyboard and accessibility