Gathering detailed insights and metrics for lottie-react-native
Gathering detailed insights and metrics for lottie-react-native
Gathering detailed insights and metrics for lottie-react-native
Gathering detailed insights and metrics for lottie-react-native
lottie-ios
Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with bodymovin and renders the vector animations natively on mobile and through React Native!
react-native-lottie-splash-screen
A lottie splash screen for react-native, hide when application loaded ,it works on iOS and Android.
lottie-react-native-extend
Lottie wrapper for React Native Web
@react-native-oh-tpl/lottie-react-native
c-api-foundation
npm install lottie-react-native
Typescript
Module System
Node Version
NPM Version
Kotlin (28.85%)
C++ (19.92%)
TypeScript (15.51%)
C# (11.15%)
Swift (11.05%)
Objective-C (4.09%)
Objective-C++ (3.57%)
JavaScript (3.24%)
Ruby (2.15%)
HTML (0.39%)
C (0.09%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
16,956 Stars
850 Commits
1,799 Forks
223 Watchers
13 Branches
142 Contributors
Updated on Jul 12, 2025
Latest Version
7.2.4
Package Id
lottie-react-native@7.2.4
Unpacked Size
280.64 kB
Size
60.34 kB
File Count
98
NPM Version
10.9.2
Node Version
22.16.0
Published on
Jul 08, 2025
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
16
Lottie component for React Native (iOS, Android, and Windows)
Lottie is an ecosystem of libraries for parsing Adobe After Effects animations exported as JSON with bodymovin and rendering them natively!
For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it by hand.
We've made some significant updates in version 6 that may impact your current setup. To get all the details about these changes, check out the changelog.
Stay informed to ensure a seamless transition to the latest version. Thank you!
lottie-react-native
(latest):yarn add lottie-react-native
Go to your ios folder and run:
pod install
lottie-react-native
(latest):yarn add lottie-react-native
yarn add @lottiefiles/dotlottie-react
Add the following to the end of your project file. For C# apps, this should come after any Microsoft.Windows.UI.Xaml.CSharp.targets
includes. For C++ apps, it should come after any Microsoft.Cpp.targets
includes.
1<PropertyGroup Label="LottieReactNativeProps"> 2 <LottieReactNativeDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\lottie-react-native\package.json'))\node_modules\lottie-react-native</LottieReactNativeDir> 3</PropertyGroup> 4<ImportGroup Label="LottieReactNativeTargets"> 5 <Import Project="$(LottieReactNativeDir)\src\windows\cppwinrt\PropertySheets\LottieGen.Auto.targets" /> 6</ImportGroup>
Add the LottieReactNative.vcxproj file to your Visual Studio solution to ensure it takes part in the build.
For C# apps, you'll need to install the following packages through NuGet:
<EnableLottieDynamicSource>false</EnableLottieDynamicSource>
in your project file and omit this reference.For C++ apps, you'll need these NuGet packages:
WinUI 2.6 (Microsoft.UI.Xaml 2.6.0) is required by default. Overriding this requires creating a Directory.Build.props file in your project root with a <WinUIVersion>
property.
In your application code where you set up your React Native Windows PackageProviders list, add the LottieReactNative provider:
1// C# 2PackageProviders.Add(new LottieReactNative.ReactPackageProvider(new AnimatedVisuals.LottieCodegenSourceProvider()));
1// C++ 2#include <winrt/LottieReactNative.h> 3#include <winrt/AnimatedVisuals.h> 4 5... 6 7PackageProviders().Append(winrt::LottieReactNative::ReactPackageProvider(winrt::AnimatedVisuals::LottieCodegenSourceProvider()));
Codegen animations are supported by adding LottieAnimation items to your project file. These will be compiled into your application and available at runtime by name. For example:
1<!-- .vcxproj or .csproj --> 2<ItemGroup> 3 <LottieAnimation Include="Assets/Animations/MyAnimation.json" Name="MyAnimation" /> 4</ItemGroup>
1// js 2<LottieView source={'MyAnimation'} />
Codegen is available to both C# and C++ applications. Dynamic loading of JSON strings at runtime is currently only supported in C# applications.
Lottie can be used in a declarative way:
1import React from 'react'; 2import LottieView from 'lottie-react-native'; 3 4export default function Animation() { 5 return ( 6 <LottieView source={require('../path/to/animation.json')} autoPlay loop /> 7 ); 8}
Additionally, there is an imperative API which is sometimes simpler.
1import React, { useEffect, useRef } from 'react'; 2import LottieView from 'lottie-react-native'; 3 4export default function AnimationWithImperativeApi() { 5 const animationRef = useRef<LottieView>(null); 6 7 useEffect(() => { 8 animationRef.current?.play(); 9 10 // Or set a specific startFrame and endFrame with: 11 animationRef.current?.play(30, 120); 12 }, []); 13 14 return ( 15 <LottieView 16 ref={animationRef} 17 source={require('../path/to/animation.json')} 18 /> 19 ); 20}
Lottie's animation view can be controlled by either React Native Animated or Reanimated API.
1import React, { useEffect, useRef, Animated } from 'react'; 2import { Animated, Easing } from 'react-native'; 3import LottieView from 'lottie-react-native'; 4 5const AnimatedLottieView = Animated.createAnimatedComponent(LottieView); 6 7export default function ControllingAnimationProgress() { 8 const animationProgress = useRef(new Animated.Value(0)); 9 10 useEffect(() => { 11 Animated.timing(animationProgress.current, { 12 toValue: 1, 13 duration: 5000, 14 easing: Easing.linear, 15 useNativeDriver: false, 16 }).start(); 17 }, []); 18 19 return ( 20 <AnimatedLottieView 21 source={require('../path/to/animation.json')} 22 progress={animationProgress.current} 23 /> 24 ); 25}
Changing color of layers:
NOTE: This feature may not work properly on Android. We will try fix it soon.
1import React from 'react'; 2import LottieView from 'lottie-react-native'; 3 4export default function ChangingColorOfLayers() { 5 return ( 6 <LottieView 7 source={require('../path/to/animation.json')} 8 colorFilters={[ 9 { 10 keypath: 'button', 11 color: '#F00000', 12 }, 13 { 14 keypath: 'Sending Loader', 15 color: '#F00000', 16 }, 17 ]} 18 autoPlay 19 loop 20 /> 21 ); 22}
.lottie
filesYou need to modify your metro.config.js
file accordingly by adding lottie
extension to the assetExts
array:
1const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config'); 2 3const defaultConfig = getDefaultConfig(__dirname); 4 5/** 6 * Metro configuration 7 * https://facebook.github.io/metro/docs/configuration 8 * 9 * @type {import('metro-config').MetroConfig} 10 */ 11const config = { 12 resolver: { 13 assetExts: [...defaultConfig.resolver.assetExts, 'lottie'], 14 }, 15}; 16 17module.exports = mergeConfig(getDefaultConfig(__dirname), config);
Create a file in the following path __mocks__/lottieMock.js
and add the following code:
1module.exports = 'lottie-test-file-stub';
Then add the following to your jest.config.js
file:
1module.exports = { 2 ... 3 moduleNameMapper: { 4 ..., 5 '\\.(lottie)$': '<rootDir>/jest/__mocks__/lottieMock.js', 6 }, 7 ... 8}
You can find the full list of props and methods available in our API document. These are the most common ones:
Prop | Description | Default |
---|---|---|
source | Mandatory - The source of animation. Can be referenced as a local asset by a string, or remotely with an object with a uri property, or it can be an actual JS object of an animation, obtained (for example) with something like require('../path/to/animation.json') . | None |
style | Style attributes for the view, as expected in a standard View . | You need to set it manually. Refer to this pull request. |
loop | A boolean flag indicating whether or not the animation should loop. | true |
autoPlay | A boolean flag indicating whether or not the animation should start automatically when mounted. This only affects the imperative API. | false |
colorFilters | An array of objects denoting layers by KeyPath and a new color filter value (as hex string). | [] |
Not all After Effects features are supported by Lottie. If you notice there are some layers or animations missing check this list to ensure they are supported.
View more documentation, FAQ, help, examples, and more at airbnb.io/lottie
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 23/30 approved changesets -- score normalized to 7
Reason
2 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
58 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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