🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-collapsy

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-collapsy

React simple accordion collapsable component

0.0.10
latest
Source
npm
Version published
Weekly downloads
16
-44.83%
Maintainers
2
Weekly downloads
 
Created
Source

react-collapsy

Simple lightweight (1.5kb minified+gzipped) accordion component

Usability

This plugin require for you to have react, after that import react-collapsy

import Accordion from 'react-collapsy';

and include css files

require('../node_modules/react-collapsy/lib/index.css');

Usage

After you imported libs, somewhere in your component's code:

<Accordion>
    <span>Some content</span>
</Accordion>

Image of Collapsy

props/options

isOpen

If passed Accordion will be render expanded

<Accordion isOpen />

onToggle

onToggle will fire after Accordion expands/collapses with boolean value passed in which will indicated if Accordion is open or closed (true, false)

<Accordion onToggle={isOpen => console.log('Is Accordion open?:', isOpen) } /> // if expanded true will be passed

title

If passed title will be displayed

<Accordion title='Some title' />

headerClass/contentWrapperClass

If passed classes will be added to header div and content wrapper div, respectfully. (e.g. 'Accordion__header ' + this.props.headerClass)

<Accordion headerClass='YourCustomHeaderClass' contentWrapperClass='YourCustomAccordionContentClass' />

Example project

Clone/download the repo followed by npm (i) install && npm start, so you can check this magnificent component in local. If you have any comment, suggestion, issue, please report it, as I will try to keep this component alive.

Keywords

react

FAQs

Package last updated on 15 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts