Accordion
3p-core / Accordion
Variable: Accordion
const
Accordion:React.FunctionComponent
<React.PropsWithChildren
<IAccordionProps
>>
A lightweight, animated accordion component.
Remarks
The accordion expands/collapses its children with a smooth height
transition.
Styling is provided by Accordion.module.scss
, but you can override the
classes if you prefer.
Param
Accordion props wrapped in
Example
Here is a minimal usage example that can be pasted into a Docusaurus page or MDX document:
<>
<Accordion title="Looking for a collapsible panel?">
I’m a trusty accordion—click to reveal, click again to hide! (Starts closed.)
</Accordion>
<Accordion title="Prefer it open right away?" defaultOpen>
I pop out of the box already expanded, but you can still tuck me away
whenever you like.
</Accordion>
<Accordion title="Want a stylish static wrapper?" staticMode>
I have the snazzy accordion look but stay permanently unfolded—
a perfect, classy frame for your content.
</Accordion>
</>