simple-accordion-test
v1.0.1
Published
Simple Accordion component - nothing too fancy!
Downloads
2
Readme
How to use this component
As the name suggest, this is a simple accordion component. Nothing fancy!
Installation:
npm install simple-accordion-test
Props
Accordion.propTypes = {
allowMultipleOpen: bool,
sections: [
{
body: string || node,
title: string || node,
defaultOpen: bool
}
]
};
Default props:
Accordion.defaultProps = {
allowMultipleOpen: false,
sections: [{ title: "Title", body: "Body" }]
};
Usage
import SimpleAccordion from "simple-accordion-test";
import 'simple-accordion-test/src/Accordion.css'
...
render() {
const accordionSections = [
{
title: "Section 1",
body: "some section",
defaultOpen: true
},
{
title: "Section 2",
body: "some other section",
defaultOpen: false
},
];
return <SimpleAccordion section={accordionSections}/>;
}