universe:react-accordion

v0.1.4Published 8 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Universe Accordion

React accordion component

Installation

meteor add universe:react-accordion

Usage

1
2import {Accordion, AccordionItem} from 'meteor/universe:react-accordion';
3
45
6	render: function () {
7	    const title = <h3>{item.label}</h3>;
8		return (
9			<Accordion>
10				{[1, 2, 3, 4, 5].map((item) => {
11					return (
12						<AccordionItem title={title} key={item}>
13							<div>
14								{`Item ${ item } content`}
15								{item === 3 ? <p><img src="https://cloud.githubusercontent.com/assets/38787/8015584/2883817e-0bda-11e5-9662-b7daf40e8c27.gif" /></p> : null}
16							</div>
17						</AccordionItem>
18					);
19				})}
20			</Accordion>
21		);
22	}
23

options / PropTypes

  • allowMultiple: allow multiple items to be open at the same time (default: false)
  • activeItems: receives either an array of indexes or a single index. Each index corresponds to the item order, starting from 0. Ex: activeItems={0}, activeItems=[0, 1, 2]

License

This package is released under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Include parts of code (also MIT) by Davi Ferreira