Accordion
Sections people can open and close.
Used in Recoverable chat, Action receipts, Research answers and 3 more patterns.
- Use it for
- Collapsible sections, including a single one people can expand.
- Not for
- Content people need to compare side by side. Try Tabs.
Accordion preview
Search accounts in the selected workspace. No external changes will be made.
Installation
npm install @stackunseen/uiimport { Accordion } from '@stackunseen/ui';@stackunseen/ui/styles.cssUsage and props
Put supporting information in labeled panels. Keep approval scope and other decision details visible. Set an item’s keepMounted to true when closing it must preserve a local form draft. Keep anything people need to make a decision outside the collapsed sections.
type'single' | 'multiple'- Allow one or several panels to be open.
itemsAccordionItem[]- Stable value, title and content for each panel. Optional disabled and keepMounted flags. Titles must not contain buttons or links.
valuestring | string[] (optional)- Controlled open panel values; update them through onValueChange. Use defaultValue for local disclosure state.
headingLevel2 | 3 | 4 | 5 | 6 (optional)- Match the surrounding heading outline. Defaults to 3.
regionboolean (optional)- Use false for nested or repeated supporting panels to avoid excess region landmarks.
All props
Loading…
For your coding agent
Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.
- Contract
- items · type · value? · onValueChange? · headingLevel?
- Keeps honest
- Keep anything people need to make a decision outside the collapsed sections.
- MCP
read_component "Accordion"on the docs endpoint
Keyboard and customization
Keyboard
Enter or Space toggles the focused panel. Arrow keys, Home and End move between enabled headings. Closed controls are hidden from keyboard navigation.
Customization
Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio