Accordion
A flexible multi-expand accordion component with smooth animations and customizable styling. Built with React, TypeScript, and Tailwind CSS for modern web applications. Perfect for FAQs, content organization, and collapsible sections.
A flexible multi-expand accordion component with smooth animations and customizable styling. Built with React, TypeScript, and Tailwind CSS for modern web applications. Perfect for FAQs, content organization, and collapsible sections.
npx uilayouts@latest add accordion
<Accordion defaultValue={['item-1']} multiple>
<AccordionItem value='item-1'>
<AccordionHeader></AccordionHeader>
<AccordionPanel></AccordionPanel>
</AccordionItem>
<AccordionItem value='item-2'>
<AccordionHeader></AccordionHeader>
<AccordionPanel></AccordionPanel>
</AccordionItem>
<AccordionItem value='item-3'>
<AccordionHeader></AccordionHeader>
<AccordionPanel></AccordionPanel>
</AccordionItem>
</Accordion>
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultValue | string | string[] | undefined |
| multiple | boolean | false | Whether the accordion allows multiple items to be active at the same time |
| children | ReactNode[] | undefined | The accordion items, including their headers and panels |
| className | string | '' | Optional CSS class for styling the accordion wrapper |