A React + styled-components based animation library with more than 180+ pre-built animations.
โ Easy-to-use animation wrapper for any element
โ Fully typed with TypeScript
โ Customizable duration, delay, iteration, timing, direction, fillMode
โ Typewriter-style text animation with blinking cursor
npm install react-animate-z
# or
yarn add react-animate-z
import React from "react";
import Animate from "react-animate-z";
import { animGroups, animNames } from "react-animate-z";
export default function App() {
return (
<Animate type="bounce" duration="1s">
<h1>Hello Animation</h1>
</Animate>
);
}
// 1. Get all animation names
import { animGroups, animNames } from "react-animate-z";
// 2. Get animation groups
console.log(animNames);
console.log(animGroups);
Prop Type Default Description
Prop | Type | Default | Description |
---|---|---|---|
type |
AnimateType |
'blurIn' |
Animation name (vรญ dแปฅ: 'blurIn' , 'bounce' , 'fadeOut' , ...) |
duration |
string | number |
'defaultDurationMap' |
Duration of the animation (can be in seconds '1s' or milliseconds 1000 ) |
timing |
TimingKey |
'ease' |
Timing function (e.g., 'ease' , 'linear' , 'ease-in' , 'ease-out' ) |
delay |
string | number |
'0s' |
Delay before the animation starts |
iteration |
number | "infinite" |
1 |
Repeat count of the animation |
direction |
string |
'normal' |
Animation direction ('normal' , 'alternate' , 'reverse' , etc.) |
fillMode |
string |
'forwards' |
How styles are applied after animation ('forwards' , 'backwards' , 'both' , 'none' ) |
tagName |
string |
'div' |
Custom HTML tag to render |
An string-arry of animation names is used to wrap the animations you want to chain.
import React, { useState } from "react";
import { AnimateTyping } from "react-animate-z";
const AnimationsForChaining = [
"swing",
"flipSlowDown",
"fadeOutToBottom",
"jelly",
];
const AnimationChain: React.FC = () => {
// const [animationIndex, setAnimationIndex] = useState(0);
// const [animationType, setAnimationType] = useState(AnimationsForChaining[0]);
// const handleChainAnimation = () => {
// const nextIndex = (animationIndex + 1) % AnimationsForChaining.length;
// setAnimationIndex(nextIndex);
// setAnimationType(AnimationsForChaining[nextIndex]);
// };
return (
<>
<AnimateTyping
heading="Hello,"
dataText={["I am Delpi", "I build animations", "I love coding!"]}
cursorColor="red"
/>
<AnimateTyping dataText="Only once" />
<AnimateTyping
heading="Fast typing:"
dataText={["speed x2", "super fast!"]}
typingSpeed={50}
deletingSpeed={20}
pauseTime={1000}
/>
</>
);
};
export default AnimationChain;
- bounce
- bounceIn
- bounceOut
- bounceElastic
- bounceSmall
- bounceRotate
- bounceJelly
- effect3D
- neonGlow
- retro3D
- emboss
- fireGlow
- iceGlow
- shine
- blurIn
- blurInZoom
- blurInScale
- blurInUp
- blurInRotate
- blurOut
- blurOutZoom
- blurOutScale
- blurOutDown
- blurOutRotate
- flash
- flashIrregular
- flashFast
- flashSlow
- flashPulse
- float
- floatSway
- floatHorizontal
- floatCircular
- floatWiggle
- glow
- glowTextFlicker
- glowRainbow
- glowBreathing
- glowGlitch
- jelly
- jellyX
- jellyY
- jellyIn
- jellyOut
- shadow
- shadowText
- shadowPulse
- shadowNeon
- spin
- spin3D
- spinX
- spinBounce
- swing
- swingPivot
- swingX
- swingY
- orbit
- orbitEllipse
- pulse
- pulseInOut
- pulseFade
- pulseFast
- pulseColor
- fadeIn
- fadeOut
- fadeInFromLeft
- fadeInFromRight
- fadeInFromTop
- fadeInFromBottom
- fadeOutToLeft
- fadeOutToRight
- fadeOutToTop
- fadeOutToBottom
- fadeInZoom
- fadeOutZoom
- fadeInRotate
- fadeOutRotate
- fadeInSkew
- fadeOutSkew
- fadeInFlipX
- fadeOutFlipX
- fadeInFlipY
- fadeOutFlipY
- fadeInPerspective
- fadeOutPerspective
- squeezeMix
- squeezeHorizontal
- squeezeVertical
- squeezeDiagonal
- squeezePulse
- squeezeBounce
- squeezeElastic
- squeezeFlash
- shakeMix
- shakeHorizontal
- shakeVertical
- shakeDiagonal
- shakeQuick
- shakeRotate
- shakeSkew
- shakeBounce
- shakeCrazy
- squeezeThenShakeX
- shakeYThenSqueeze
- squeezeShakeCrazy
- slideInFromLeft
- slideInFromRight
- slideOutToLeft
- slideOutToRight
- slideInFromTop
- slideInFromBottom
- slideOutToTop
- slideOutToBottom
- slideInFromLeftOvershoot
- slideInFromRightOvershoot
- slideOutToLeftOvershoot
- slideOutToRightOvershoot
- slideInFromTopOvershoot
- slideInFromBottomOvershoot
- slideOutToTopOvershoot
- slideOutToBottomOvershoot
- flip
- flipIn
- flipOut
- flipSlowDown
- flipToLeft
- flipToRight
- flipFromTop
- flipToTop
- flipToBottom
- flipFromBottom
- flipFromLeftToCenter
- flipFromRightToCenter
- flipRich
- flipToTopRich
- flipToBottomRich
- flipToTopLeftRich
- flipToRightRich
- flipFromTopRich
- flipFromBottomRich
- flipFromLeftToCenterRich
- flipFromRightToCenterRich
- fold
- foldDeep
- unfold
- unfoldDeep
- hangOnLeft
- hangOnRight
- hangOnTop
- hangOnBottom
- hangOnLeftSwing
- hangOnRightSwing
- hangOnTopSwing
- hangOnBottomSwing
- hangOnOscillate
- hangOnDrop
- zoomIn
- zoomOut
- zoomInFromLeft
- zoomInFromRight
- zoomInFromTop
- zoomInFromBottom
- zoomOutToLeft
- zoomOutToRight
- zoomOutToTop
- zoomOutToBottom
- rotateCW
- rotateACW
- rotateSlowDown
- rotateX
- rotateY
- rotateFromLeft
- rotateFromRight
- rotateToLeft
- rotateToRight
- rotateFromTop
- rotateFromBottom
- rotateToTop
- rotateToBottom
- heartBeat
- tada
- hinge
- lightSpeedInLeft
- lightSpeedOutRight
- popIn
- popOut
- popBounceIn
- popBounceOut
- popUpIn
- popUpOut
- popRotateIn
- popRotateOut
- popBlurIn
- popBlurOut
- popLeftIn
- popLeftOut
- popRightIn
- popRightOut
- rubberBand
- jello
- wobble
- rollIn
- jackInTheBox
MIT ยฉ Delpi