react-accordion-container
v1.1.0
Published
Assumption free react-dom and react-native compatible accordion container
Downloads
20
Maintainers
Readme
React Accordion Container
Getting Started
yarn add react-accordion-container
or
npm install --save react-accordion-container
Example
import React from 'react';
import {
Accordion,
AccordionItem,
AccordionItemBody
} from 'react-accordion-container';
const Component = () => (
<Accordion>
<AccordionItem>
{({ isActive, onClick }) => (
<div>
<h3 role="button" onClick={onClick}>
My first accordion item
</h3>
<AccordionItemBody>
<p>The body of my first accordion item</p>
</AccordionItemBody>
</div>
)}
</AccordionItem>
<AccordionItem>
{({ isActive, onClick }) => (
<div>
<h3 role="button" onClick={onClick}>
My second accordion item
</h3>
<AccordionItemBody>
<p>The body of my second accordion item</p>
</AccordionItemBody>
</div>
)}
</AccordionItem>
</Accordion>
);
More examples are available as Storybook stories: npm run storybook
.
License
Licensed under the MIT License, Copyright © 2018-present Florian Nagel.
See LICENSE for more information.