deku-accordion

2.4.0 • Public • Published

deku-accordion Build Status

Accordion component for deku

Install

$ npm install --save deku-accordion

Usage

import Accordion from 'deku-accordion';
 
export function render() {
    const items = [{
        content: <div>Content 1</div>,
        heading: 'Heading 1'
    }, {
        content: <div>Content 2</div>,
        heading: 'Heading 2',
        active: true
    }, {
        content: <div>Content 3</div>,
        heading: 'Heading 3',
        active: true
    }];
 
    return (
        <Accordion items={items} multiple/>
    );
}

Attributes

  • 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

Package Sidebar

Install

npm i deku-accordion

Weekly Downloads

2

Version

2.4.0

License

MIT

Last publish

Collaborators

  • gillstrom
  • kevva