This page demonstrates an expand/collapse widget. Each widget is wrapped in a container with the class "example". The content that is shown/hidden is placed in a container with the class "details".
<details> and <summary> provide accessible, built-in behavior for this pattern.