Home

Blogs

Finger Tap Loading CSS Animation

2023-05-02T04:26:08Z


Author

  • vinay kurve

Made with

  • Lottie files

About the code

Finger Tap Loading CSS Animation

Compatible browsers

Chrome, Firefox, Safari, Opera, Edge



How to use lottie animation in react js


1. Choose Your Lottie

Choose an animation, either one of your own or you can select one from the wide range of free animations on . Make sure you have your animation in Lottie format (.json).


2. Install NPM package (@lottiefiles/react-lottie-player)
npm install @lottiefiles/react-lottie-player
Read Docs
3. Add lottie to your react project

Import package in your code

import { Player} from '@lottiefiles/react-lottie-player'

Add the element Player and set the src prop to a URL pointing to a valid Lottie JSON.


  <Player
  autoplay
  loop
  src="https://assets1.lottiefiles.com/packages/lf20_gc88Qf.json"
  style={{ height: '300px', width: '300px' }}
/>
  

You can also download the lottie json and add into your project. only change the src prop value to the path of json file

More Integrate options are available at lottiefiles.com/integrations