Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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)