Disclosure
Collapse
Collapse — animates showing/hiding content by height. Pair the toggling control with `aria-expanded` and `aria-controls` pointing at this element's `id`.
ReactVueWeb Components
View in Storybook Playground
Examples
<button aria-expanded={open} aria-controls="c1" onClick={() => setOpen(!open)}>
Toggle
</button>
<Collapse id="c1" open={open}>content</Collapse> Props
| Name | Type | Default | Description |
|---|---|---|---|
open required | boolean | — | Whether the content is expanded. |
Accessibility
- Body/background contrast is ≥ 7:1 (AAA) in both light and dark.
- Every interaction works with the keyboard alone.
- The focus ring is always visible.
- Respects prefers-reduced-motion and stops excessive motion.
Every component is designed to meet WCAG 2.1 AAA.