Skip to main content

Expand/Collapse Widget Examples

Demonstrations of accessible expand/collapse patterns using aria-expanded.

Example 1: Basic Expand/Collapse

Example 2: Multiple Expand/Collapse Sections

Example 3: Inline Expand/Collapse

Example 4: Initially Expanded Content

This section starts in the expanded state to show important information by default.

Keyboard instructions:

  • Tab - Move focus to the button
  • Enter or Space - Toggle expansion state
  • Shift+Tab - Move focus backward

The button uses aria-expanded to indicate its current state to assistive technology.