New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-transitions-library

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-transitions-library

A react component library for animations.

1.10.2
latest
Source
npm
Version published
Weekly downloads
24
118.18%
Maintainers
1
Weekly downloads
 
Created
Source

React-Transitions-Library

Installation

Install react-tranisions-library via yarn or npm

yarn

yarn add react-transitions-library react-transition-group

npm

npm install react-transitions-library react-transition-group

Docs

Homepage

Available Transition

Examples

Single Transition

const Example = () => {
    const [show, setShow] = useState(false);
    return (
    	<div>
          <FadeInTransition timeout={400} from={0} to={1} in={show}>
            React Transitions Library
          </FadeInTransition>
          <button onClick={() => setShow(true)}>in</button>
          <button onClick={() => setShow(false)}>out</button>
    	</div> 
    );
}

Combined Transition

const Example = () => {
    const [show, setShow] = useState(false);
    return (
        <div>
          <FadeInTransition in={show} timeout={400} from={0} to={1}>
            <ZoomInTransition in={show} from={0.8} to={1} timeout={400}>
              <h1>React Transitions Library</h1>
            </ZoomInTransition>
          </FadeInTransition>
          <button onClick={() => setShow(true)}>in</button>
          <button onClick={() => setShow(false)}>out</button>
        </div> 
    );
}

Transition Group

Transition on mount and on unmount.

const FadeInZoomInTransition = ({ children, ...props }) => (
	<FadeInTransition {...props} timeout={400} from={0} to={1}>
          <ZoomInTransition {...props} from={0.8} to={1} timeout={400}>
            {children}
          </ZoomInTransition>
	</FadeInTransition>
);

const Example = () => {
    const [show, setShow] = useState(false);
    return (
        <div>
          <TransitionGroup>
            {show ? (
            	<FadeInZoomInTransition key={"FadeInZoomInTransition"}>
                  <h1>React Transitions Library</h1>
            	</FadeInZoomInTransition>
            ) : null}
          </TransitionGroup>
          <button onClick={() => setShow(true)}>in</button>
          <button onClick={() => setShow(false)}>out</button>
        </div> 
    );
}

Note

Feel free to create a Pull Request.

Keywords

react

FAQs

Package last updated on 21 May 2022

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