Learn how to integrate lottie animations into your react application effortlessly.
Install lottie react dependency from npm
npm install lottie-react
Import animated icon json file in your component
import Lottie from "lottie-react";
import animationData from "./your_animation.json";
const LottieIcon = () => (
<div style={{ width: 150, height: 150 }}>
<Lottie animationData={animationData} loop={true} />
</div>
);
export default LottieIcon;
Add custom events to control animation
<Lottie animationData={animationData} loop={false} autoplay={false} onComplete={() => console.log("done")} />
Find free animations at Unicornicons.