To use @dotlottie/react-player in your React project, import the component and use it as follows:
@dotlottie/react-player
import React from 'react'; import { DotLottiePlayer, Controls } from '@dotlottie/react-player'; import '@dotlottie/react-player/dist/index.css'; const App = () => { return ( <div> <DotLottiePlayer src="/path-to-lottie.lottie" autoplay loop > <Controls /> </DotLottiePlayer> </div> ); }; export default App;
Last updated 10 months ago