Accordion
Accordion component with single or multiple open items, flush, bordered and separated styles and an animated height.
How to use it
Run npx @blossomui/react add accordion, or copy src/components/UI/Accordion/Accordion.tsx into your React project and import it.
import { Accordion } from './components/ui/Accordion'Props
AccordionItem
| Prop | Type | Description |
|---|---|---|
| id (required) | string | |
| title (required) | string | |
| content (required) | ReactNode | |
| disabled | boolean |
AccordionProps
| Prop | Type | Description |
|---|---|---|
| items (required) | AccordionItem[] | |
| multiple | boolean | Allow several items to be open at the same time. |
| defaultOpen | string[] | Ids of the items that start open. |
| variant | 'flush' | 'bordered' | 'separated' | `flush` only draws lines between items, `bordered` wraps all of them and `separated` makes each one a card. |