Navigation
Accordion
Stacked sections that expand to show detail. Use for secondary or optional content; don't hide required fields inside.
size: 'sm'for dense panels (32px rows, 8px padding); default rows are 40px.variant:default(one bordered box),flush(no box, for side panels and FilterPanel),separated(each item its own card).- Each item takes
title, optionalsubtitle(one muted line),icon,meta(a string, or any node such as a Badge),actions(IconButtons outside the toggle),disabledandcontent. - Long titles wrap; a string
metais cut with an ellipsis at 40% of the row. - Controlled with
open+onOpenChange, or uncontrolled withdefaultOpen.multiple={false}keeps one open.
When to use
Hide secondary or optional detail under headings people expand when needed: FAQs, filter groups, line-item details.
Use something else
Content everyone needs → show it. Switching between peer views → Tabs.
Do
- Use
size="sm"andvariant="flush"in dense side panels. - Show a
metacount or badge so people know what's inside. - Put item actions in
actions, not inside the title.
Don't
- Don't hide required form fields inside a collapsed item.
- Don't nest accordions.
Props
| Prop | Type |
|---|---|
items required | Array<{ id: string; title: React.ReactNode; subtitle?: React.ReactNode; icon?: string; meta?: React.ReactNode; actions?: React.ReactNode; disabled?: boolean; content: React.ReactNode }> |
defaultOpen | string[] |
multiple | boolean |
variant | 'default' | 'flush' | 'separated' |
size | 'sm' | 'md' |
open | string[] |
onOpenChange | (open: string[]) => void; className?: string |
Use
const { Accordion } = window.Tessera;
const el = React.createElement(Accordion, { /* props */ });