★ GitHub
Component

Accordion

Expandable panels for organizing content with smooth height transitions.

Basic Usage

Single item open at a time
tsx
const items = [ { key: "1", label: "What is StarKit?", content: <p>...</p> }, { key: "2", label: "Is it accessible?", content: <p>...</p> } ]; <Accordion items={items} />

Bordered & Multiple

Bordered container allowing multiple panels to open
tsx
<Accordion items={items} bordered multiple />

Props

PropTypeDefaultDescription
items *AccordionItem[]—Array of items containing key, label, and content.
multiplebooleanfalseAllow multiple items to be open simultaneously.
defaultOpenKeysstring[][]Keys of initially open items.
openKeysstring[]—Controlled open keys.
onChange(keys: string[]) => void—Callback when open keys change.
borderedbooleanfalseWraps the accordion in a bordered container with a shadow.