Accordion
Expandable/collapsible content sections using native details/summary elements. Keyboard accessible by default.
What is UI Foundations?
A token-first, Figma-aligned design system for building consistent UIs across brands and modes.
How do I install it?
Install via npm: npm install ui-foundations
Can I customize the tokens?
Yes — override semantic tokens or add brand-specific theme files.
Anatomy
1
2
Accordion item
Content area
- 1 Summary — clickable trigger with chevron indicator
- 2 Content — expandable body area
Options
Table of options
| Property | Values | Default |
|---|---|---|
| title | text | — |
| open | true / false | false |
| disabled | true / false | false |
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between summary elements |
| Enter / Space | Toggles the focused item open/closed |
Accessibility
- Uses native
<details>and<summary>elements — keyboard and screen reader support is built-in. - The browser manages
aria-expandedstate automatically. - Disabled items use
pointer-events: noneand muted color to indicate non-interactivity.
Design checklist
All color themesWorks across light and dark modes.
Keyboard interactionsNative details/summary behavior.
Design tokensComponent-scoped tokens (
--accordion-*).