1.2.5 • Published 2 years ago

@alitinart/react-animate v1.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@alitinart/react-animate

Animate your react components with ease

NPM JavaScript Style Guide

Install

npm install --save @alitinart/react-animate

Usage

import React, { Component } from 'react'

import Animate from '@alitinart/react-animate'
import '@alitinart/react-animate/dist/index.css'

class Example extends Component {
  render() {
    return (
      <Animate
        animationDuration='2s'
        animationName='slideRight'
        classToGive='animation-started'
        customAnimationClass='myCustomAnimation'
      >
        <h1>Hello World 😁</h1>
      </Animate>
    )
  }
}

Creating your own custom animation

index.tsx

import React, { Component } from 'react'

import Animate from '@alitinart/react-animate'
import '@alitinart/react-animate/dist/index.css'

class Example extends Component {
  render() {
    return (
      <Animate
        animationDuration='2s'
        classToGive='animation-started'
        customAnimationClass='customAnimation' // <--- Your custom animation class goes here
      >
        <h1>Hello World 😁</h1>
      </Animate>
    )
  }
}

index.css

/* Creating Custom Animation */

.customAnimation {
  animation: customAnimation;
}

@keyframes customAnimation {
  0%{
    transform: translateY(100px);
    opacity: 0;
  }
  100%{
    transform: translateY(0);
    opacity: 1;
  }
}

Props

Prop NameDescriptionUsage
animationDurationAmount of time needed to run that animationanimationDuration='2s or 2ms'
animationNameSelect one of the pre made animations of this libraryanimationName='slideRight or slideLeft or fadeIn'
classToGiveSelect a class that is given to your element once it enters the screenclassToGive='animation-started'
customAnimationClassSelect your own animation by classcustomAnimationClass='myCustomAnimation'

License

MIT © alitinart

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.9-a

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago