Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gillstrom/deku-accordion
Accordion component for deku
https://github.com/gillstrom/deku-accordion
Last synced: 26 days ago
JSON representation
Accordion component for deku
- Host: GitHub
- URL: https://github.com/gillstrom/deku-accordion
- Owner: gillstrom
- License: mit
- Created: 2015-10-10T12:48:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-04T08:05:48.000Z (over 7 years ago)
- Last Synced: 2024-12-05T09:23:11.872Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://accordion.surge.sh/
- Size: 16.6 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-deku - deku-accordion - Accordion component for deku (Components)
README
# deku-accordion [![Build Status](https://travis-ci.org/gillstrom/deku-accordion.svg?branch=master)](https://travis-ci.org/gillstrom/deku-accordion)
> Accordion component for deku
## Install
```
$ npm install deku-accordion
```## Usage
```js
import Accordion from 'deku-accordion';export const render = () => {
const items = [{
content:Content 1,
heading: 'Heading 1'
}, {
content:Content 2,
heading: 'Heading 2',
active: true
}, {
content:Content 3,
heading: 'Heading 3',
active: true
}];return (
);
}
```## Props
* `class` adds classes to the component
* `items` is the array of accordion elements
* `multiple` lets you have several items open at once
* `onClick` returns currently active indexes and clicked item## License
MIT © [Andreas Gillström](http://github.com/gillstrom)