Gathering detailed insights and metrics for react-lottie-wrapper
Gathering detailed insights and metrics for react-lottie-wrapper
Gathering detailed insights and metrics for react-lottie-wrapper
Gathering detailed insights and metrics for react-lottie-wrapper
Render After Effects animations on React based on lottie-web
npm install react-lottie-wrapper
Typescript
Module System
Node Version
NPM Version
JavaScript (84.13%)
HTML (8.13%)
Shell (7.74%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
19 Stars
162 Commits
3 Forks
7 Branches
1 Contributors
Updated on Jul 13, 2022
Latest Version
1.1.8
Package Id
react-lottie-wrapper@1.1.8
Unpacked Size
16.96 kB
Size
5.60 kB
File Count
5
NPM Version
6.11.3
Node Version
12.12.0
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
2
1
23
https://github.com/donovanclarke/react-lottie
bodymovin is Adobe After Effects plugin for exporting animations as JSON, also it provide bodymovin.js for render them as svg/canvas/html.
We currently support solids, shape layers, masks, alpha mattes, trim paths, and dash patterns. And we’ll be adding new features on a regular basis.
You can go forward, backward, and most importantly you can program your animation to respond to any interaction.
Bundle vector animations within your app without having to worry about multiple dimensions or large file sizes. Alternatively, you can decouple animation files from your app’s code entirely by loading them from a JSON API.
Learn more › http://airbnb.design/lottie/
Looking for lottie files › https://www.lottiefiles.com/
Install through npm:
npm install --save react-lottie-wrapper
Import pinjump.json.json as animation data
1import React, { Component } from "react" 2import Lottie from "react-lottie-wrapper"; 3import * as animationData from "./pinjump.json" 4 5export default class LottieControl extends Component { 6 constructor(props) { 7 super(props); 8 this.state = { 9 isStopped: false, 10 isPaused: false 11 }; 12 this.handleAnimationAction = this.handleAnimationAction.bind(this); 13 } 14 15 handleAnimationAction(action, value) { 16 if (action === "play" || action === "stop") { 17 const isStopped = value; 18 return this.setState({ isStopped }); 19 } 20 this.setState(prevState => ({ 21 isPaused: !prevState.isPaused 22 })); 23 }; 24 25 render() { 26 const { isStopped, isPaused } = this.state; 27 const buttonStyle = { 28 display: "block", 29 margin: "10px auto" 30 }; 31 32 const defaultOptions = { 33 loop: true, 34 autoplay: true, 35 animationData: animationData.default, 36 rendererSettings: { 37 preserveAspectRatio: "xMidYMid slice" 38 } 39 }; 40 41 return ( 42 <> 43 <Lottie 44 options={defaultOptions} 45 height={400} 46 width={400} 47 isStopped={isStopped} 48 isPaused={isPaused} 49 /> 50 <button 51 style={buttonStyle} 52 onClick={this.handleAnimationAction("stop", true)} 53 > 54 stop 55 </button> 56 <button 57 style={buttonStyle} 58 onClick={this.handleAnimationAction("play", false)} 59 > 60 play 61 </button> 62 <button 63 style={buttonStyle} 64 onClick={this.handleAnimationAction("pause")} 65 > 66 pause 67 </button> 68 </> 69 ) 70 } 71} 72
The <Lottie />
Component supports the following properties:
options required
animationData required
rendererSettings required
Below are a the available options that are exposed through lottie-web, these options are available in react-lottie-wrapper.
options = {
loop: // optional
autoplay: // optional
animationData: // required
path: // optional
rendererSettings: {
context: // optional
preserveAspectRatio: // optional
clearCanvas: // optional
progressiveLoad: // optional
hideOnTransparent: // optional
className: // optional
id: // optional
}
}
renderAs optional [default: div
]
You are given the option of either a div
or span
element.
styles optional [default: {{height: 100%, width: 100%, outline: none}}
]
Insert inline styling for container.
className optional [default: ""
]
Insert class name for container.
loop optional [default: false
]
Should animation loop.
autoplay optional [default: false
]
Should animation begin to play automatically.
isClickToPauseDisabled optional [default: false
]
Disables click event to pause the animation.
isStopped optional [default: false
]
Handler to stop the animation.
isPaused optional [default: false
]
Handler to pause the animation.
width optional [default: 100%
]
Pixel value for containers width.
height optional [default: 100%
]
Pixel value for containers height.
speed optional [default: 1
]
Set the speed of the animation (normal === 1
).
role optional [default: button
]
ariaLabel optional [default: animation
]
title optional [default: ""
]
tabIndex optional [default: 0
]
Set the tab index of the container for accessibility.
eventListeners optional [default: []
]
This is an array of objects containing a eventName
and callback
function that will be registered as eventlisteners on the animation object. refer to bodymovin#events where the mention using addEventListener, for a list of available custom events.
example:
1eventListeners=[ 2 { 3 eventName: 'complete', 4 callback: () => console.log('the animation completed:'), 5 }, 6]
Your contributions and suggestions are heartily welcome.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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