lottie-react-native /lottie-react-native
Lottie wrapper for React Native.
★ 17,215⑂ 1,795👁 216⑃ 554● 913▤ 60
+0
日增长
17,215
stars
1,795
forks
216
watchers
554
prs
913
issues
60
releases
README
Lottie React Native
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.
Installing
Breaking Changes in v6!
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 migration guide.
Stay informed to ensure a seamless transition to the latest version. Thank you!
iOS and Android
Requires React Native 0.84 or newer and the New Architecture. For older React
Native versions, use lottie-react-native 7.3.x.
- Install lottie-react-native (latest):
yarn add lottie-react-native
Go to your ios folder and run:
pod install
Web
- Install lottie-react-native (latest):
yarn add lottie-react-native
- Add dependencies for web players:
yarn add @lottiefiles/dotlottie-react
Windows (React Native = 0.63)
Install the lottie-react-native npm package. (Click to expand)
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.
xml
$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\lottie-react-native\package.json'))\node_modules\lottie-react-native
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:
- LottieGen.MsBuild
- Microsoft.UI.Xaml
- Win2D.uwp
- Microsoft.Toolkit.Uwp.UI.Lottie
- This package is used for loading JSON dynamically. If you only need codegen animation, you can set false in your project file and omit this reference.
For C++ apps, you'll need these NuGet packages:
- LottieGen.MsBuild
- Microsoft.UI.Xaml
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 property.
In your application code where you set up your React Native Windows PackageProviders list, add the LottieReactNative provider:
csharp
// C
PackageProviders.Add(new LottieReactNative.ReactPackageProvider(new AnimatedVisuals.LottieCodegenSourceProvider()));
cpp
// C++
include
include
...
PackageProviders().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:
xml
js
// js
Codegen is available to both C and C++ applications. Dynamic loading of JSON strings at runtime is currently only supported in C applications.
Top issues
#1307New Arch: `autoPlay=false` odd behavior23 comments · 2024-11-27#1344Lottie-react-native (v7.0.0) Auto-Firing Events (e.g., onAnimationFinish) on Initialization in RN 0.78.2 + New Arch14 comments · 2025-05-21#1294`pointer-events` style ignored on Android8 comments · 2024-10-25#1178Lottie 6.5.1: Source uri to local file not working on android. Error: sun.net.www.protocol.file.FileURLConnection cannot be cast to java.net.HttpURLConnection5 comments · 2024-02-07#1004Cannot restart playing animation from the beginning until it's finished (on IOS)3 comments · 2023-04-03#1121Android is off by one when specifying frame to play1 comments · 2023-10-17#1485Android build fails on AGP 9 (React Native 0.88): BuildConfig fields need buildFeatures.buildConfig = true0 comments · 2026-10-21#1479Migrate core Codegen imports to the public React Native API0 comments · 2026-10-14
Discussions
#1376Lottie-react-native not working on iOS (iPhone 16 Pro Max, Expo SDK 53)0 comments · 2025-09-08#1340Lottie Loading Issue0 comments · 2025-05-08#1339Loading dotLottie from blob0 comments · 2025-05-02#1328Last 1 or 2 frames are missing0 comments · 2025-03-05#1275adding webStyle to README.md0 comments · 2024-08-30#1227Adding properties in the generated SVG0 comments · 2024-05-03#1224Adding onClick handler to particular elements inside lottie1 comments · 2024-04-23#1207How to use Lottie snapshots as texture for ThreeJs plane0 comments · 2024-03-22
Latest release
Release 7.5.1 v7.5.1 2026-11-137.5.1 (2026-11-13) Bug Fixes ios: make constantsToExport return type non-optional (1486) (455b886)