Accordion
A vertically stacked set of interactive headings that each reveal an associated section of content built with Headless UI.
Made by imskyleen
Animate UI is an open-source distribution of React components built with TypeScript, Tailwind CSS, and Motion.
Installation
Usage
Props
Animate UI props
AccordionButton
Prop | Type | Default |
---|---|---|
chevron? | boolean | true |
transition? | Transition | { type: 'spring', stiffness: 150, damping: 17 } |
AccordionPanel
Prop | Type | Default |
---|---|---|
transition? | Transition | { type: 'spring', stiffness: 150, damping: 17 } |
Don't delete from the DOM
The choice made is the same as Headless UI, i.e. to remove the element from the DOM for accessibility and performance reasons. However, this may pose a problem for SEO. If you want your Accordion content to be taken into account by Google, please replace the DisclosurePanel component with (because the Accordion component is based on the Disclosure component):
Credits
- We use Headless UI for the disclosure component.
- We take our inspiration from Shadcn UI for the accordion style.