go to this site
LottieFiles: Download Free lightweight animations for website & apps.
Write-up
How To Use Lottie Animations in a React App - LottieFiles
working steps
npm install react-lottie
npm install prop-types
// import "./styles.css";
import React from "react";
import Lottie from "react-lottie";
import animationData from "../../Lottie/page-not-found.json";
//here set the file path of lottie.json file
export default function Error() {
const defaultOptions = {
loop: true,
autoplay: true,
animationData: animationData,
rendererSettings: {
preserveAspectRatio: "xMidYMid slice",
},
};
return (
<div>
<Lottie options={defaultOptions} height={500} width={400} />
</div>
);
}