Expand/Collapse Widget Demo
Example 1 ARIA + JS
This is a simple expand/collapse component controlled by a button. It uses aria-expanded and aria-controls so assistive technology can understand the relationship.
- Click the header button to toggle.
- Use Tab to focus, then Enter/Space to activate.
Example 2 Starts open
Shipping: Orders typically ship within 2 business days.
Returns: You can return items within 30 days if unused and in original packaging.
Read more in the help center.
Example 3 FAQ
Yes. The controlled region can include any HTML: lists, links, inputs, and more.