npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

redux-accordion

v1.0.73

Published

A reusable and customisable accordion component for react/redux

Downloads

8

Readme

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)