1.0.7 • Published 5 years ago

react-transition-box v1.0.7

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Installation

$ yarn add react-transition-box # or using npm

Usage

import React from 'react';
import TransitionBox from 'react-transition-box';
import LargeContent from './LargeContent';
import SmallContent from './SmallContent';

export default function App({ isLarge }) {
  return (
    <TransitionBox duration={500}>
      {isLarge ? <LargeContent /> : <SmallContent />}
    </TransitionBox>
  );
}

API

<TransitionBox> component accepts these following props:

NameDescriptionType
durationTransition duration in ms.number
timingFunction?Transition timing function. Default: 'ease'string
childrenIts size changes will trigger the container transition.Node or string
innerStyle?Pass this props to override default style of inner div.React.CSSProperties
...othersOther valid attributes to be added to the root div.any

License

react-transition-box is available under the MIT License.