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

react-animate-x

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-animate-x

A React implimentation of [Animate X](https://github.com/escaladesports/animate-x), a super small animation library for animating components, numbers, objects, and arrays.

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

React Animate X

A React implimentation of Animate X, a super small animation library for animating components, numbers, objects, and arrays.

Installation

With npm:

npm install --save react-animate-x

Or with Yarn:

yarn add react-animate-x

Usage

Simple

import Animate from 'react-animate-x'

...

<Animate from={0}, to={100}>
   {state => (
      <div style={{ transform: `translateX(${state}px)` }}>Animating!</div>
   )}
</Animate>

Easing

The simplest way to apply easing to your animation is with the eases module, but any easing function will work.

import Animate from 'react-animate-x'
import { bounceOut } from 'eases'

...

<Animate
   from={{
      x: 0,
      y: 0,
   }}
   to={{
      x: 100,
      y: 150,
   }}
   easing={bounceOut}>
   {({ x, y }) => (
      <div style={{ transform: `translate(${x}px, ${y}px)` }}>Animating!</div>
   )}
</Animate>

Props

PropDescriptionDefault
fromA number, object, or array to start tweening from0
toA number, object, or array to tween to (must match schema of "from")100
durationThe number of milliseconds the animation should last1000
easingAn easing function for the animationfunction(time){ return time }
loopAdd this prop to loop the animation infinitelyfalse
onStartA function that will be called every time the animation startsn/a
onEndA function that will be called every time the animation endsn/a
animatingSet to false to stop the animationn/a

Keywords

react

FAQs

Package last updated on 12 Apr 2018

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