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 = ;var Panel = AccordionPanel;var React = ;var accordion = <Accordion> <Panel header="hello">this is panel content</Panel> <Panel header="title2">this is panel content2 or other</Panel> </Accordion>;React;
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
License
rc-accordion is released under the MIT license.