react-accordion-container

1.1.0 • Public • Published

React Accordion Container CircleCI codecov npm Airbnb JavaScript Style Guide styled with prettier

Getting Started

yarn add react-accordion-container

or

npm install --save react-accordion-container

Example

import React from 'react';
import {
  Accordion,
  AccordionItem,
  AccordionItemBody
} from 'react-accordion-container';
 
const Component = () => (
  <Accordion>
    <AccordionItem>
      {({ isActive, onClick }) => (
        <div>
          <h3 role="button" onClick={onClick}>
            My first accordion item
          </h3>
          <AccordionItemBody>
            <p>The body of my first accordion item</p>
          </AccordionItemBody>
        </div>
      )}
    </AccordionItem>
    <AccordionItem>
      {({ isActive, onClick }) => (
        <div>
          <h3 role="button" onClick={onClick}>
            My second accordion item
          </h3>
          <AccordionItemBody>
            <p>The body of my second accordion item</p>
          </AccordionItemBody>
        </div>
      )}
    </AccordionItem>
  </Accordion>
);

More examples are available as Storybook stories: npm run storybook.

License

Licensed under the MIT License, Copyright © 2018-present Florian Nagel.

See LICENSE for more information.

Package Sidebar

Install

npm i react-accordion-container

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

427 kB

Total Files

40

Last publish

Collaborators

  • floriannagel