New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-tween-to

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-tween-to

A simple react Higher Order Component that is smart enough to do some easy animation for you

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

#react-tween-to

A simple react Higher Order Component that is smart enough to do some easy animation for you.

###How to use it


import { ReactTween } from 'react-tween-to';

const SimpleComponent = ({ tweenStyles }) => {
	return (
		<div className='tween' style={{...tweenStyles}}>Tween Me!!!!</div>
	);
};

const SimpleComponentTween = ReactTween(SimpleComponent);

const ParentComponent = () => {
	const tweenProps = {
		timing : 500,
		easing : 'easeOut',
		opacity : 1,
		width : '100px',
		height : '100px'
	};

	return (
		<div className='parent'>
			<SimpleComponentTween {...tweenProps} />
		</div>
	);
};

The Tween component calculates any changes to the props after the componentDidMount and render a new animation based on the new props that get past to it.

Available props are:

  • timing: PropTypes.number => milliseconds of the tween animations
  • easing: PropTypes.string => Options are; simple, easeIn, and easeOut
  • left: PropTypes.string => CSS value. You can use px, em, rem, or %
  • right: PropTypes.string => CSS value. You can use px, em, rem, or %
  • top: PropTypes.string => CSS value. You can use px, em, rem, or %
  • bottom: PropTypes.string => CSS value. You can use px, em, rem, or %
  • width: PropTypes.string => CSS value. You can use px, em, rem, vw, or %
  • height: PropTypes.string => CSS value. You can use px, em, rem, vh, or %
  • fontSize: PropTypes.string => CSS value. You can use px, em, or rem
  • opacity: PropTypes.number => CSS value from 0-1

Important Note! Once you use a certain measurement unit for a property, keep it. If you use 3px at first and want to go to 1rem, the calculation will break. Use 3px => 16px instead.

Have Fun!

FAQs

Package last updated on 14 Jul 2017

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