0.2.1 • Published 5 years ago

height-transition v0.2.1

Weekly downloads
44
License
-
Repository
-
Last release
5 years ago

Basic Height Transition Library for React

Simple height transition for collapse elements.

Installation

This library written with react-hook so you have to install version of react 16.8.4 or above.

npm i height-transition -S

Setup

Just connect your button with its ref and pass to props HeightTransition component.

import React, { Fragment, useRef } from 'react';
import HeightTransition from 'height-transition';

const App = () => {
   const toggleElem = useRef(null);
     return (
    <Fragment>
      <button ref={toggleElem}>Toggle</button>
      <HeightTransition 
         styles={styles} 
         toggle={toggleElem} 
         animation="ease-out" 
         time="100ms"
         >
        Your Content
      </HeightTransition>
    </Fragment>
  );
}

API

ApiDescriptionDefault
stylesSet your own style.
toggleSet your element ref
animationSet your animation styledefault : "ease"
timeSet your animation timedefault : "300ms"

Live Example

Checkout

License

MIT

0.2.1

5 years ago

0.2.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago