📄️ When to Use
The Accordion and AccordionItem components are unstyled and render HTML markups that are compliant with the Accordion Pattern. They are built on top of some React Hooks which can be used directly in your code. There are a few reasons that you might want to do it:
📄️ Creating Accordion
First, we create an Accordion component with useAccordion, useAccordionProvider, and
📄️ Creating AccordionItem
Second, create an AccordionItem component with the useAccordionItem and
📄️ Styles
Here are the styles for the two components we have created.
📄️ Putting together
Now we can use our own Accordion and AccordionItem components as normal. They are