react-jqueryui-accordion
v1.0.6
Published
A simple react component for jquery-ui's accordion
Downloads
7
Maintainers
Readme
react-jqueryui-accordion
React jQuery-UI Accordion
Install
$ npm install --save react-jqueryui-accordion
from https://npmjs.com/package/react-jqueryui-accordion
Usage
<Accordion>
<h1>Title 1</h1>
<div>Content</div>
<h1>Title 2</h1>
<div>Content</div>
</Accordion>
Pass options (docs):
<Accordion options={{height: 'fill'}}>
<h1>Title 1</h1>
<div>Content</div>
<h1>Title 2</h1>
<div>Content</div>
</Accordion>
Select panel and interact with active
:
<Accordion ref="accordion">
...
</Accordion>
// get current active panel index
var index = this.refs.accordion.active;
// activate 3rd panel
this.refs.accordion.active = 2;
Get currently active header element:
var headerElement = this.refs.accordion.activeHeader;