npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@abeman/react-native-splash-screen

v1.4.0

Published

Splash screen

Readme

react-native-splash-screen

A performant splash screen for React Native apps with smooth transitions and memory optimization.

Features

  • 🚀 Smooth Transitions - Configurable fade animations
  • 🎯 Prevent White Flash - Seamless transition from splash to app
  • 💾 Memory Optimization - Built-in memory management
  • 🔧 Highly Configurable - Customize duration, animations, and behavior
  • 📱 Cross Platform - iOS and Android support
  • 🏗️ New Architecture - TurboModule support

Installation

npm install @abeman/react-native-splash-screen
# or
yarn add @abeman/react-native-splash-screen

iOS Setup

  1. Run pod install
cd ios && pod install
  1. Configure in AppDelegate (Swift)
import SplashScreen

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
  func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    // Show splash screen on app launch
    SplashScreen.show()
    return true
  }
}

Android Setup

  1. Add splash screen drawable at android/app/src/main/res/drawable/launch_screen.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:drawable="@color/splash_background" />
  <item>
    <bitmap
      android:src="@mipmap/ic_launcher"
      android:gravity="center" />
  </item>
</layer-list>
  1. Define colors at android/app/src/main/res/values/colors.xml:
<resources>
  <color name="splash_background">#FFFFFF</color>
</resources>
  1. Update theme in android/app/src/main/res/values/styles.xml:
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
  <item name="android:windowBackground">@drawable/launch_screen</item>
  <item name="android:windowDisablePreview">false</item>
</style>
  1. Configure in MainActivity (Kotlin):
import com.splashscreen.SplashScreenModule

class MainActivity : ReactActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    SplashScreenModule.showSplash(this)
    super.onCreate(savedInstanceState)
  }
}

Usage

Basic Usage

import SplashScreen from '@abeman/react-native-splash-screen';

// In your app's entry point (App.tsx)
useEffect(() => {
  // Hide splash screen after app loads
  SplashScreen.hide();
}, []);

Advanced Usage

import SplashScreen from '@abeman/react-native-splash-screen';

// Show splash screen with configuration
SplashScreen.show({
  preventFlash: true
});

// Hide with smooth fade animation
SplashScreen.hide({
  fade: true,
  duration: 0.5,      // seconds
  preventFlash: true
});

// Release memory when needed
SplashScreen.releaseMemory();

API Reference

Methods

show(config?: SplashScreenConfig)

Shows the splash screen.

Parameters:

  • config (optional):
    • preventFlash: boolean - Prevent white flash (default: true)

hide(config?: SplashScreenConfig)

Hides the splash screen.

Parameters:

  • config (optional):
    • fade: boolean - Enable fade animation (default: true)
    • duration: number - Animation duration in seconds (default: 0.3)
    • preventFlash: boolean - Prevent white flash during transition

releaseMemory()

Releases cached resources to free up memory.

TypeScript Support

import SplashScreen, { SplashScreenConfig } from '@abeman/react-native-splash-screen';

const config: SplashScreenConfig = {
  fade: true,
  duration: 0.5,
  preventFlash: true
};

SplashScreen.hide(config);

Example

import React, { useEffect, useState } from 'react';
import { View, Text, ActivityIndicator } from 'react-native';
import SplashScreen from '@abeman/react-native-splash-screen';

export default function App() {
  const [isLoading, setIsLoading] = useState(true);

  useEffect(() => {
    loadAppData();
  }, []);

  const loadAppData = async () => {
    try {
      // Load your app data, authenticate user, etc.
      await fetchUserData();
      await loadAppResources();

      setIsLoading(false);

      // Hide splash screen with smooth transition
      SplashScreen.hide({
        fade: true,
        duration: 0.5,
        preventFlash: true
      });
    } catch (error) {
      // Handle error
      SplashScreen.hide();
    }
  };

  if (isLoading) {
    return (
      <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
    <ActivityIndicator size="large" />
      </View>
  );
  }

  return (
    <View style={{ flex: 1 }}>
  <Text>Welcome to the app!</Text>
  </View>
);
}

Performance Tips

  1. Preload Resources: Call SplashScreen.show() as early as possible in your native code
  2. Optimize Images: Use appropriately sized images for splash screen
  3. Memory Management: Call releaseMemory() after hiding splash screen in memory-constrained situations
  4. Prevent Flash: Always use preventFlash: true for seamless transitions

Troubleshooting

White flash on Android

Make sure you've set the windowBackground in your app theme and use preventFlash: true when hiding.

Splash screen not showing on iOS

Ensure you're calling SplashScreen.show() in didFinishLaunchingWithOptions before any other setup.

TypeScript errors

Make sure to import types: import { SplashScreenConfig } from '@abeman/react-native-splash-screen'

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library