core / makeup-expander

Creates expand/collapse interactivity between a host element and its content, with support for click, focus, and hover triggers.


Click (no auto-collapse)

Content stays expanded until the host is clicked again.

Expanded content. A link


Auto-collapse flyouts

Each flyout collapses when focus or the mouse leaves.

Click:

Click flyout. A link

Focus:

Focus flyout. A link

Focus or hover:

Focus or hover flyout. A link

Hover (with stealth button for keyboard access):

Hover to expand

Hover flyout. A link

Click or spacebar (readonly input with icon):

Click or spacebar flyout. A link


Tooltip (useAriaExpanded=false)

Uses a CSS class instead of aria-expanded. Suitable for tooltips where the ARIA role handles state.

Tooltip content.


Events

expander-expand and expander-collapse fired by any expander on this page.