Gathering detailed insights and metrics for react-native-lottie-splash-view
Gathering detailed insights and metrics for react-native-lottie-splash-view
Gathering detailed insights and metrics for react-native-lottie-splash-view
Gathering detailed insights and metrics for react-native-lottie-splash-view
npm install react-native-lottie-splash-view
Typescript
Module System
Node Version
NPM Version
Kotlin (42.3%)
Swift (23.49%)
TypeScript (20%)
Ruby (8.56%)
JavaScript (5.56%)
Objective-C (0.07%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
8 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Apr 28, 2025
Latest Version
0.0.4
Package Id
react-native-lottie-splash-view@0.0.4
Unpacked Size
81.37 kB
Size
21.67 kB
File Count
54
NPM Version
10.8.2
Node Version
18.20.8
Published on
Apr 24, 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
2
20
Android Demo | iOS Demo | Only Lottie Splash |
---|---|---|
![]() | ![]() | ![]() |
1npm install react-native-lottie-splash-view 2# or 3yarn add react-native-lottie-splash-view
This library provides a smoother and more native launch experience compared to a JS-only splash screen.
On Android, it supports showing the splash before React Native is initialized, and on iOS, it integrates with the required LaunchScreen.storyboard.
logoanimation.json
into your ios/YourApp
folderAppDelegate.swift
📍 Path:
ios/YourApp/AppDelegate.swift
Import SplashView
at the top:
1import SplashView
Add this method:
1private func showSplashScreen() {
2 let options: [String: Any] = [
3 "lottie": "logoanimation",
4 "backgroundColor": "#2a37e6",
5 "duration": 10000,
6 "resizeMode": "cover",
7 "repeat": true
8 ]
9 SplashView.shared.showSplash(options: options)
10}
Then call showSplashScreen()
inside:
1func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2 showSplashScreen()
3 return true
4}
We recommend editing LaunchScreen.storyboard
to:
This creates a seamless transition from native splash to Lottie.
📍 Path:
android/app/src/main/res/raw/logoanimation.json
Use lowercase and underscores in the filename.
📍 Path:
android/app/src/main/java/com/<your_project_name>/MainActivity.kt
At the top, import:
1import com.splashview.SplashView
Then modify the onCreate
method:
1override fun onCreate(savedInstanceState: Bundle?) { 2 super.onCreate(savedInstanceState) 3 4 if (!SplashView.splashShownFromJS) { 5 val options = mapOf( 6 "lottie" to "logoanimation", 7 "backgroundColor" to "#2a37e6", 8 "resizeMode" to "cover", 9 "duration" to 10000 10 ) 11 SplashView.showSplashView(this, options) 12 } 13}
If
launch_screen.xml
is missing, Android will show the background defined in your theme, or default to a black screen.
The splash screen will be hidden only when both of the following conditions are met:
duration
timer (if set) has completeduseHideSplash
are satisfied (i.e., the app is ready and the minimum duration has elapsed)This means:
duration: 10000
and your app becomes ready in 5 seconds, the splash will stay visible for the full 10 seconds.This ensures both proper timing and visual consistency between native and JS readiness.
If no Lottie is passed or you want a custom fallback:
📍 Path:
android/app/src/main/res/layout/launch_screen.xml
1<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" 4 android:background="@color/splash_background"> 5 6 <ImageView 7 android:layout_gravity="center" 8 android:src="@drawable/my_new_logo" 9 android:layout_width="wrap_content" 10 android:layout_height="wrap_content" /> 11</FrameLayout>
If this file is missing, Android will fallback to the app icon from the mipmap folders or to the window background color.
📍 File:
android/app/src/main/res/values/styles.xml
windowIsTranslucent
to Show Lottie InstantlyTo display the Lottie animation immediately on app start (skipping launch_screen.xml
), you can add:
1<item name="android:windowIsTranslucent">true</item>
Example:
1<resources> 2 <!-- Base application theme. --> 3 <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> 4 <item name="android:windowNoTitle">true</item> 5 <item name="android:editTextBackground">@drawable/rn_edit_text_material</item> 6 <item name="android:autofilledHighlight">@drawable/autofill_highlight</item> 7 <item name="android:windowIsTranslucent">true</item> 8 </style> 9</resources>
✅ In this setup, there’s no need for
SplashTheme
orlaunch_screen.xml
.
The Lottie animation will appear right away.
You can optionally define a SplashTheme
if you want to apply a separate theme only during the initial app launch:
styles.xml
1<resources> 2 <style name="SplashScreen_SplashAnimation"> 3 <item name="android:windowExitAnimation">@android:anim/fade_out</item> 4 </style> 5 6 <style name="SplashScreen_SplashTheme" parent="Theme.AppCompat.NoActionBar"> 7 <item name="android:windowAnimationStyle">@style/SplashScreen_SplashAnimation</item> 8 </style> 9</resources>
AndroidManifest.xml
(optional)1<activity 2 android:name=".MainActivity" 3 android:theme="@style/SplashScreen_SplashTheme" 4 ... >
This will show the custom SplashTheme only during the native app start.
MainActivity.kt
In MainActivity.kt
, reset the theme to your app theme:
1override fun onCreate(savedInstanceState: Bundle?) { 2 setTheme(R.style.AppTheme) // Revert to main theme 3 super.onCreate(savedInstanceState) 4 ... 5}
When to use this?
When you can skip this?
windowIsTranslucent
to show Lottie immediatelySplashTheme
is optional, only needed if you want a custom look during the launchlaunch_screen.xml
, you don’t need to reference it in AndroidManifest.xml
SplashTheme
if you enable windowIsTranslucent
and let the Lottie animation play immediatelyFunction | Description |
---|---|
showSplash | Show splash manually |
hideSplash | Hide splash |
showTimedSplash | Show splash for a duration |
useHideSplash | Hook to auto-hide after delay |
Key | Type | Description |
---|---|---|
lottie | string | File name without .json (optional) |
duration | number | Duration in milliseconds (optional) |
backgroundColor | string | Hex color (e.g. #FFFFFF ) (optional) |
resizeMode | string | 'cover' or 'contain' (default: 'contain' ) |
repeat | boolean | Repeat animation (default: false) |
1import { showTimedSplash, useHideSplash } from 'react-native-lottie-splash-view';
2
3function App() {
4 useHideSplash({ minimumDuration: 3000 });
5
6 const showSplash = () => {
7 showTimedSplash({
8 lottie: 'logoanimation',
9 duration: 4000,
10 backgroundColor: '#ffffff',
11 resizeMode: 'contain',
12 repeat: false,
13 });
14 };
15
16 return <YourApp />;
17}
Feature | Android | iOS |
---|---|---|
JS control (show/hide ) | ✅ Yes | ❌ No |
Lottie before React loads | ✅ Yes | ❌ No (storyboard required) |
Static splash fallback | ✅ launch_screen.xml | ✅ storyboard |
Timed splash | ✅ Yes | ❌ No |
1cd ios && pod install && cd ..
.json
is in "Copy Bundle Resources"res/raw/
.json
1cd android && ./gradlew clean && cd ..
0.68+
MIT
No vulnerabilities found.
No security vulnerabilities found.