Skip to Content

📱 SplashScreen

The SplashScreen is a customizable React Native component used to display a branded startup screen using local or remote images, videos, or Lottie animations. It does not post any data to the server and works entirely on the client side.


✨ Features

  • 🖼️ Supports static images, videos, Lottie animations
  • 🌗 Auto theme switching (light/dark)
  • 📶 Fully supports local & remote media (no server dependency)
  • 🌈 Optional gradient overlay
  • ⏱️ Auto-redirect after timeout or media end
  • 🖥️ Fullscreen & responsive layout

🖼️ Preview

SplashScreen Preview 1
SplashScreen Preview 2

📦 Setup Store First

Before using <SplashScreen />, make sure to initialize the splash state store:

👉 See Splash Screen Store Setup

This store handles:

  • Encrypted MMKV state persistence
  • AES-based decryption
  • Global hydration via Zustand

👉 See Auth Store Setup

🚀 Usage Example

SplashScreen.tsx
import React from "react"; import { Auth } from "@zezosoft/zezo-ott-react-native-ui-kit"; import { useAuthStore } from "@ZezoOtt/store/authStore"; import { resetAndNavigate } from "@ZezoOtt/utils/NavigationUtil"; import { Route } from "@navigation/routes"; import { useSplashStore } from "@ZezoOtt/store/splashStore"; const SplashScreen = () => { const { user } = useAuthStore(); const { splash } = useSplashStore.getState(); return ( <Auth.SplashScreen splashScreenConfig={splash.app_splesh_screen} backgroundImage={{ source: splash.login_poster as string, resizeMode: "cover", gradientSplitBackground: 0.4, }} onRedirect={() => { if (user) { resetAndNavigate(Route.TabBar); } else { resetAndNavigate(Route.LoginWithPhone); } }} /> ); }; export default SplashScreen;

🔗 See related route definition: Route enum from @navigation/routes.ts

✅ No server call – all media rendering and redirects happen locally


🔧 Props

SplashScreenProps

PropTypeDescription
splashScreenConfigSplashScreenConfigMedia source & display configuration
innerContainerStyleViewStyle (optional)Style override for inner container (e.g., padding, margin)
onRedirect() => voidCallback after timeout or media ends
themeAppTheme (optional)Force a specific theme (light or dark)
backgroundImageBackgroundImageProps (optional)Background image + gradient config

SplashScreenConfig

PropertyTypeDescription
sourcestringMedia source path or URL
type"image" | "video" | "lottie-animation" (optional)Type of media to display
widthnumberWidth of the splash content
heightnumberHeight of the splash content
isStaticboolean (optional)If true, disables animation/playback
screenTimenumber (optional)Timeout duration in seconds
fullscreenboolean (optional)Whether to use fullscreen layout
resizeMode'contain' | 'cover' | 'stretch' | 'repeat' | 'center'Resize mode for the splash media
backgroundColorstring (optional)Background color behind media

BackgroundImageProps

PropertyTypeDescription
sourcestring | null (optional)Background image path or URL
onImageError(error: Error) => void (optional)Callback on image load failure
gradientSplitBackgroundnumber (optional), Example 0.4Gradient split position (0 to 1)
resizeMode'cover' | 'contain' | 'stretch' | 'repeat'Resize mode for the background image

🔄 How It Works

  1. Component renders at app launch.
  2. Local or remote media is displayed.
  3. Timeout starts (if set).
  4. When timeout or media ends → onRedirect() is triggered.

💡 Developer Notes

IssueSolution
Remote image not loadingEnsure it’s over HTTPS and accessible
Video not playingInstall and link react-native-video
Lottie not displayingConfirm your Lottie JSON is mobile compatible
Delay in renderingUse local assets or cache remote ones with useInitSplashCacheSync

✅ Summary

The SplashScreen:

  • Works fully client-side
  • Uses local or remote media
  • Doesn’t send or store any data externally
  • Easily integrates with any navigation flow

✍️ Created by Naresh Dhamu – Powered by ZezoSoft

Last updated on