React Accordeon
React Accordeon component with expand/collapse CSS animation. The event trigger can be configured to any component, such in the Navigation and Content
Components
<Accordeon>
Primary component of React Accordeon. It keeps and handles the state of all the elements.
Props
header
(optional)
A valid React component that will be rendered in a <header>
html tag. This component will be provided with the two property functions expandAll and collapseAll.
footer
(optional)
A valid React component that will be rendered in a <footer>
html tag. This component will be provided with the two property functions expandAll and collapseAll.
Example
<Panel>
The Panel component is the container for each element in the accordeon. This will create the collapse/expand animation for the Content component.
Props
expanded
(optional)
Boolean value to configure an initial state for the Panel. If true, the Panel is expanded. If false, the Panel is collapsed.
Example
Item expanded
Item collapsed
or the expanded property can also be omitted
<Nav>
This component accepts any string or any valid React component to render the Panel Header.
Props
This does not require any property at this moment.
<Content>
Any string, html tag, or a valid React component
Props
This does not require any property at this moment.
Examples
Accordeon with plain strings in the Nav and Content
Given valid React Components
With some valid HTML
Accordeon with Header and Footer