react-native-moon-splash
v1.0.7
Published
A fully customizable native splash screen for React Native with fade-in animation and logo sizing.
Downloads
7
Maintainers
Readme
README.md:
# react-native-moon-splash 🌙
A **fully customizable native splash screen** for React Native apps with **fade-in animation**, **logo sizing**, and **text support**.
Works on **Android** and **iOS**.
---
## Features
- Native splash screen (appears before JS loads)
- Custom **background color**
- Custom **logo** with **width & height**
- Optional **fade-in animation**
- Optional **text label**
- Auto-hide after specified **duration**
- Fully **TypeScript supported**
---
## Installation
```bash
npm install react-native-moon-splash
# or
yarn add react-native-moon-splash
```iOS
cd ios && pod installUsage
import React, { useEffect } from "react";
import { View, Text } from "react-native";
import MoonSplash from "react-native-moon-splash";
export default function App() {
useEffect(() => {
MoonSplash.show({
backgroundColor: "#000",
logo: "app_logo", // native resource name
logoWidth: 150,
logoHeight: 150,
text: "Welcome to Moon App",
duration: 2500, // in milliseconds
animation: "fade", // fade | none
});
}, []);
return (
<View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
<Text>🌙 Main App Loaded</Text>
</View>
);
}API
MoonSplash.show(options)
| Option | Type | Default | Description | |
| ----------------- | -------- | ----------- | -------------------------------------------------------- | -------------------------- |
| backgroundColor | string | "#FFFFFF" | Background color of splash | |
| logo | string | undefined | Name of native logo asset (Android drawable / iOS asset) | |
| logoWidth | number | 100 | Width of logo | |
| logoHeight | number | 100 | Height of logo | |
| text | string | "" | Optional text under logo | |
| duration | number | 1000 | Duration before auto-hide (ms) | |
| animation | `"fade" | "none"` | "none" | Fade-in animation for logo |
MoonSplash.hide()
Manually hide the splash screen.
Example
See example/ folder for a working React Native demo.
TypeScript Support
Fully typed. Autocomplete works in editors like VSCode.
License
MIT © Devendra
