README
rc-accordion
rc-accordion ui component for react
Development
npm install
npm start
Example
http://localhost:8000/examples/
online example: http://react-component.github.io/accordion/examples/
Feature
- support ie8,ie8+,chrome,firefox,safari
install
Usage
var Accordion = require('rc-accordion');
var Panel = Accordion.Panel;
var React = require('react');
var accordion = (
<Accordion>
<Panel header="hello">this is panel content</Panel>
<Panel header="title2">this is panel content2 or other</Panel>
</Accordion>
);
React.render(accordion, container);
API
Accordion
props:
name | type | default | description |
---|---|---|---|
activeKey | String | The first panel key | current active Panel key |
onSwitch | Function(key) | noop | called when accordion Panel is changed |
Accordion.Panel
props
name | type | default | description |
---|---|---|---|
header | String or node | header content of Panel |
key
If no key provide, key value will be the panel index.
Test Case
http://localhost:8000/tests/runner.html?coverage
Coverage
http://localhost:8000/node_modules/rc-server/node_modules/node-jscover/lib/front-end/jscoverage.html?w=http://localhost:8000/tests/runner.html?coverage
License
rc-accordion is released under the MIT license.