Gathering detailed insights and metrics for lottie-react-web
Gathering detailed insights and metrics for lottie-react-web
Gathering detailed insights and metrics for lottie-react-web
Gathering detailed insights and metrics for lottie-react-web
npm install lottie-react-web
Typescript
Module System
Node Version
NPM Version
JavaScript (83.89%)
HTML (8.25%)
Shell (7.86%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
187 Stars
158 Commits
46 Forks
4 Watchers
13 Branches
26 Contributors
Updated on Jul 09, 2025
Latest Version
2.2.2
Package Id
lottie-react-web@2.2.2
Size
251.05 kB
NPM Version
6.9.0
Node Version
10.16.3
Published on
Jun 10, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
1
24
Lottie component for React with runtime animation control.
Lottie is a library for the Web, Android and iOS that parses Adobe After Effects animations exported as JSON with bodymovin and renders them natively on each platform!
For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it by hand.
This library is a react-lottie fork that adds the capability for runtime animation control and fixes lots of bugs.
Get started with Lottie by installing the node module with yarn or npm:
yarn add lottie-react-web
or
npm i --save lottie-react-web
<Lottie>
component can be used in a declarative way:
1import React from 'react'; 2import Lottie from 'lottie-react-web' 3import animation from './animation.json' 4 5const App = () => ( 6 <Lottie 7 options={{ 8 animationData: animation 9 }} 10 /> 11) 12 13export default App
By default it will automatically play the animation in loop.
Lottie's animation control can be set via props. Here is an example of a toggle animation that reacts on click:
1import React, { Component } from 'react'; 2import Lottie from 'lottie-react-web' 3import toggleAnimation from './toggleAnimation.json' 4 5export default class App extends Component { 6 this.state = { isToggled: false } 7 8 render() ( 9 <div 10 onClick={() => { 11 this.setState(state => { isToggled: !state.isToggled}) 12 }} 13 > 14 <Lottie 15 direction={this.state.isToggled ? 1 : -1} 16 options={{ 17 animationData: toggleAnimation, 18 loop: false, 19 }} 20 /> 21 </div> 22 ) 23) 24 25export default App
These are all props available:
Prop | Description | Default |
---|---|---|
options | Mandatory - The object representing the animation settings that will be instantiated by bodymovin. Defines the source of animation (animationData ), loop, autoplay, a few others. See details in the section below. | { autoplay: true, loop: true } |
animationControl | This is where you can change the animation at runtime. A key value pair of a After Effects property path and the a custom value to apply to it. See details below. | — |
width | Sets the width of the animation container. | 100% |
height | Sets the heigth of the animation container. | 100% |
isStopped | A boolean flag indicating whether or not the animation is stopped. | false |
isPaused | A boolean flag indicating whether or not the animation is paused. | false |
speed | An integer indicating the speed of the animation ( 1 is 100% .) | 1 |
segments | An array of two integers indicating the beginning and ending frame of the animation | Defaults to play entire animation |
forceSegments | A boolean indicating wether the segments should play immediately or sequentially | false |
direction | An integer indicating wether the animation progresses in the usual (1 ) or reverse (-1 ) direction | 1 |
ariaRole | A string indicating the animation container ariaRole property | "button" |
ariaLabel | A string indicating the animation container ariaLabel property | "animation" |
title | A string indicating the animation container title property | "" |
Defines the animation settings that will be instantiated by bodymovin. Currently a subset of the bodymovin options are supported.
Either the animationData OR path must be specified.
Prop | Description | Default |
---|---|---|
animationData | Mandatory - The source of the animation. | — |
path | Mandatory - The path to the animation. | — |
assetsPath | Mandatory - The root path for external assets. | images |
loop | Play animation non-stop in a loop. | true |
autoplay | Automatically play animation when it is instantiated. | true |
renderer | The method for rendering the animation. | svg |
rendererSettings | Customize bodymovin aspect ratio configurations. | — |
You can target an specific After Effects layer property and change it at
runtime by passing setting a property
object on the <Lottie>
prop. Example:
1import React from 'react'; 2import Lottie from 'lottie-react-web' 3import animation from './animation.json' 4 5const Animation = ({ x, y }) => ( 6 <Lottie 7 options={{ 8 animationData: animation, 9 }} 10 animationControl={{ 11 'Square,Transform,Position': [x, y], 12 }} 13 /> 14) 15 16export default Animation
This will override the Position
value of the layer JoyStkCtrl01
at runtime.
Lottie is compatible with Joystick 'n Sliders After Effects plugin, so you can create amazing animations easily.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 8/28 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
110 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More