An accordion component build with React.
yarn add awesome-react-accordion
npm install awesome-react-accordion
import Accordion, {Collapsible} from "awesome-react-accordion"
render(){
const items = [
{
title: 'Title 1',
content: 'Content 1'
},
{
title: 'Title 2',
content: 'Content 2'
},
{
title: 'Title 3',
content: 'Content 3'
},
]
return (
// Multiple items
<Accordion items={items} />
// If you only want one item
<Collapsible title="Single item title">Single item content</Collapsible>
)
}
For complete examples on how each prop works check the examples included (see Development)
items (type: array, default: []) An array of items to be shown.
multiple (type: boolean, default: false) Allow multiple items to be visible
speed (type: int, default: 350) The animation speed in milliseconds
Run examples
git clone git@bitbucket.org:icoldoweb/awesome-react-accordion.git
cd awesome-react-accordion
yarn
yarn start
// a new tab will open in your default browser on http://localhost:8080