Gathering detailed insights and metrics for @lottiefiles/lottie-player
Gathering detailed insights and metrics for @lottiefiles/lottie-player
Gathering detailed insights and metrics for @lottiefiles/lottie-player
Gathering detailed insights and metrics for @lottiefiles/lottie-player
@lottiefiles/react-lottie-player
Lottie web player wrapper for React
@lottiefiles/dotlottie-web
Lottie and DotLottie player for the web
@lottiefiles/vue-lottie-player
Lottie player wrapper for Vue.js by LottieFiles
@lottiefiles/dotlottie-react
React wrapper around the dotlottie-web library
Lottie viewer/player as an easy to use web component! https://lottiefiles.com/web-player
npm install @lottiefiles/lottie-player
Typescript
Module System
Node Version
NPM Version
TypeScript (44.52%)
JavaScript (32.71%)
HTML (22.77%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,620 Stars
225 Commits
187 Forks
32 Watchers
48 Branches
20 Contributors
Updated on Jul 10, 2025
Latest Version
2.0.12
Package Id
@lottiefiles/lottie-player@2.0.12
Unpacked Size
6.61 MB
Size
1.61 MB
File Count
19
NPM Version
10.8.2
Node Version
20.18.0
Published on
Nov 04, 2024
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
5
46
This is a Web Component for easily embedding and playing Lottie animations and the Lottie-based Telegram Sticker (tgs) animations in websites.
For full documentation, visit docs.lottiefiles.com/lottie-player
1<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
1<script src="/node_modules/@lottiefiles/lottie-player/dist/lottie-player.js"></script>
1<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/tgs-player.js"></script>
1<script src="/node_modules/@lottiefiles/lottie-player/dist/tgs-player.js"></script>
1npm install --save @lottiefiles/lottie-player
1import "@lottiefiles/lottie-player";
Add the element lottie-player
and set the src
property to a URL pointing to a valid Bodymovin JSON.
1<lottie-player 2 autoplay 3 controls 4 loop 5 mode="normal" 6 src="https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json" 7 style="width: 320px" 8> 9</lottie-player>
You may set and load animations programatically as well.
1<lottie-player autoplay controls loop mode="normal" style="width: 320px"> 2</lottie-player>
1const player = document.querySelector("lottie-player"); 2player.addEventListener("rendered", (e) => { 3 //Load via URL 4 player.load("https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json"); 5 // or load via a Bodymovin JSON string/object 6 player.load( 7 '{"v":"5.3.4","fr":30,"ip":0,"op":38,"w":315,"h":600,"nm":"new", ... }' 8 ); 9});
Add the element tgs-player
and set the src
property to a URL pointing to a valid TGS JSON.
1<tgs-player autoplay loop mode="normal" src="https//domain/example.tgs"> 2</tgs-player>
Import the player either as
1import * as LottiePlayer from "@lottiefiles/lottie-player";
or
1require("@lottiefiles/lottie-player");
Use as follows
1<lottie-player 2 autoplay 3 controls 4 loop 5 mode="normal" 6 src="https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json" 7 style="width: 320px" 8></lottie-player>
Import the player either as
1import * as LottiePlayer from "@lottiefiles/lottie-player";
or
1require("@lottiefiles/lottie-player");
Use as follows
1<lottie-player 2 autoplay 3 controls 4 loop 5 mode="normal" 6 src="https://assets3.lottiefiles.com/packages/lf20_UJNc2t.json" 7 style="width: 320px" 8></lottie-player>
For typescript projects an added step is required. The component must be declared as a JSX intrinsic element. Create a file 'declarations.d.ts' in the root of your project and add the code below to the file.
1declare namespace JSX { 2 interface IntrinsicElements { 3 "lottie-player": any; 4 } 5}
Create a lottie-player.js
file inside the /plugins
folder and add the below code to the file:
1import * as LottiePlayer from "@lottiefiles/lottie-player";
Open nuxt.config.js
file and add the following entry to register the newly created plugin:
1export default { 2 plugins: [{ src: "~/plugins/lottie-player.js", mode: "client" }] 3}
This is because the player script needs to be rendered on the browser/client side and we must configure Nuxt to load the script on the client side only.
You would then be able to use the player as follows inside any component:
1<lottie-player 2 autoplay 3 controls 4 loop 5 style="width:400px" 6 src="https://assets3.lottiefiles.com/packages/lf20_RItkEz.json" 7 speed="1" 8 debug 9/>
The process for Nuxt 3 is slightly different.
Create a lottie-player.client.ts
file inside the /plugins
folder and add the below code to the file:
1import * as LottiePlayer from "@lottiefiles/lottie-player"; 2 3export default defineNuxtPlugin(() => LottiePlayer);
Your plugin will be automatically available throughout your Nuxt application thanks to the plugin auto-registration. Note the client
suffix in the name of the plugin - this tells Nuxt to load it only on the client side, as the Lottie Player script can only be rendered in the browser.
You would then be able to use the player as follows inside any component:
1<lottie-player 2 autoplay 3 controls 4 loop 5 style="width:400px" 6 src="https://assets3.lottiefiles.com/packages/lf20_RItkEz.json" 7 speed="1" 8 debug 9/>
The process to import in NextJS is similar to Nuxt in the sense that on SSR mode, the library must be declared as a client side module. To do this, import the library within a react useEffect hook.
1import React, { useRef } from "react"; 2 3export default function Home() { 4 const ref = useRef(null); 5 React.useEffect(() => { 6 import("@lottiefiles/lottie-player"); 7 }); 8 return ( 9 <div className={styles.container}> 10 <main className={styles.main}> 11 <lottie-player 12 id="firstLottie" 13 ref={ref} 14 autoplay 15 controls 16 loop 17 mode="normal" 18 src="https://assets4.lottiefiles.com/packages/lf20_gb5bmwlm.json" 19 style={{ width: "300px", height: "300px" }} 20 ></lottie-player> 21 </main> 22 </div> 23 ); 24}
Do add a declaration file named declaration.d.ts to the root of the project as well
1declare namespace JSX { 2 interface IntrinsicElements { 3 "lottie-player": any; 4 } 5}
Full documentation on player properties, methods, events and styling for the Lottie-player are available here.
Project | Description |
---|---|
lottie-react | A React component for the Lottie Web player. |
lottie-vue | A Vue component for the Lottie player. |
svelte-lottie-player | Lottie player component for use with Svelte. |
jLottie | jLottie is suitable as a general purpose lottie player, though implements a subset of the features in the core player - this approach leads to a tiny footprint and great performance. |
lottie-interactivity | This is a small library to add scrolling, cursor interactivity and interaction chaining to your Lottie Animations. |
dotLottie | dotLottie is an open-source file format that aggregates one or more Lottie files and their associated resources into a single file. They are ZIP archives compressed with the Deflate compression method and carry the file extension of ".lottie". |
lottie-js | The library consists of methods to map the Lottie JSON to the object model and interact with properties as well as manipulate them. |
lottie-theming | A library to extract themable properties and apply different themes to a given Lottie |
MIT License © LottieFiles.com
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 6/25 approved changesets -- score normalized to 2
Reason
SAST tool is not run on all commits -- score normalized to 1
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
66 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