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

react-collapsable

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-collapsable

A Collapsable React Component

1.0.4
latest
Source
npm
Version published
Weekly downloads
7
-56.25%
Maintainers
1
Weekly downloads
 
Created
Source

React Collapsable

Build Status Maintainability Test Coverage

A collapsable react component, animated using CSS transitions based on the height of your content.

Installation

npm i react-collapsable -S

or with yarn;

yarn add react-collapsable

Usage

import React, { useState } from 'react'
import Collapsable from 'react-collapsable'

const myComponent = () => {
    const [isOpen, toggleOpen] = useState(false);
    return (
        <div>
            <button onClick={() => toggleOpen(!isOpen)}>Toggle</button>
            <Collapsable isOpen={isOpen}>
                <h1>My Content In Here!</h1>
            </Collapsable>
        </div>
    )
}

Props

PropRequiredDefault
isOpen (boolean)
minAnimationDuration (in seconds)0.3
maxAnimationDuration (in seconds)1
speedDivider (in milliseconds)1000
easing (css string)"ease-in-out"

Keywords

react

FAQs

Package last updated on 17 Jul 2019

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