1.0.73 • Published 7 years ago

redux-accordion v1.0.73

Weekly downloads
60
License
MIT
Repository
-
Last release
7 years ago

Redux Accordion Header Image

Redux Accordion

Need an accordion for your React and/or Redux project? Look no further. You can have a single or multiple instances running at one. Redux Accordion is a fully featured accordion component, built using react/redux with ECMAScript 6. Simple to set up, simple to use and most importantly hopefully as simple as possible to maintain and build upon.

Installation

npm install redux-accordion

Example

<Accordion
  {...this.props}
  uniqId={'testAccordion'}>

  <AccordionSection
   title="Section 1">
   {*/ Content Goes Here /*}
  </AccordionSection>

  <AccordionSection
   title="Section 2">
   {*/ Content Goes Here /*}
  </AccordionSection>

</Accordion>

Usage

Redux accordion uses a redux store to manage its state. However it also has the option to use local component state.

With the local component state option you can simply run npm install redux-accordion, include Accordion & AccordionSection and your good to go. The second requires you to hook up the actions and reducers to your app.

Sections:

Accordion

<Accordion
  {...this.props}
  uniqId={'testAccordion'}
  singleOpen={true}>

  {*/ Content Goes Here /*}

</Accordion>
  • You can set the uniqId if you want to apply an id to your accordion. This also specifies how this instance is referenced in the reducer (non-component version)
  • You can set singleOpen={true} if you want to limit the accordion to only open a single section at a time

AccordionSection

<AccordionSection
 title="Section 1">
 {*/ Content Goes Here /*}
</AccordionSection>
  • The title dictates what is displayed on the accordion bar
  • You can set openByDefault={true} if you want this section to be open by default

Installation with redux actions & stores

  • Clone git repo or run npm install redux-accordion
  • Connect the actions and reducer into your app (node_modules/redux-accordion/redux)
  • Include Accordion & AccordionSection.
  • Done. Accordions for everyone :)

Contributing

It doesn't matter if you're a veteran or not. Everyone brings something awesome to the party so please contribute. If you have any suggestions give a shout on twitter to @reduxAccordion 1. Fork it! 2. Create your feature branch: git checkout -b my-new-feature 3. Commit your changes: git commit -am 'Add some feature' 4. Push to the branch: git push origin my-new-feature 5. Submit a pull request :D

Credits

Created and maintained by @rorykermack

License

WTFPL (100% Open Source)

1.0.73

7 years ago

1.0.721

8 years ago

1.0.72

8 years ago

1.0.71

8 years ago

1.0.70

8 years ago

1.0.69

8 years ago

1.0.68

8 years ago

1.0.67

8 years ago

1.0.66

8 years ago

1.0.65

8 years ago

1.0.64

8 years ago

1.0.63

8 years ago

1.0.62

8 years ago

1.0.61

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago