Skip to main content

🚀 Splash Screen – React Native

A customizable Splash Screen built with React Native, Animated API.
This component provides a smooth entry animation and can be extended to navigate to any screen.


📸 Preview

Screenshot


📂 Folder Structure

project-root/ │ ├── components/ │ └── Splash.js │ ├── App.js └── package.json


✅ Prerequisites

Make sure you have these dependencies installed:

npm install react
npm install react-native

🔗 Usage

Update your Splash.js with below code:

import React, { useEffect, useRef } from 'react';
import { View, StyleSheet, Animated, Text } from 'react-native';

export default function Splash() {

const fadeAnim = useRef(new Animated.Value(0)).current;
const scaleAnim = useRef(new Animated.Value(0.8)).current;
const lineAnim = useRef(new Animated.Value(0)).current;

useEffect(() => {
// Animate on mount
Animated.parallel([
Animated.timing(fadeAnim, {
toValue: 1,
duration: 2000,
useNativeDriver: true,
}),
Animated.spring(scaleAnim, {
toValue: 1,
friction: 5,
useNativeDriver: true,
}),
Animated.timing(lineAnim, {
toValue: 1,
duration: 1500,
delay: 500,
useNativeDriver: false,
}),
]).start();

const timer = setTimeout(() => {
// move to other screen
}, 3000);
return () => clearTimeout(timer);
}, []);

const lineWidth = lineAnim.interpolate({
inputRange: [0, 1],
outputRange: [0, 75],
});

return (
<View style={styles.container1}>
<Animated.View
style={[
styles.logoContainer,
{
opacity: fadeAnim,
transform: [{ scale: scaleAnim }],
},
]} >
<Text style={styles.title}>SPLASH</Text>
<View style={styles.subtitleContainer}>
<Animated.View style={[styles.line, { width: lineWidth }]} />
<Text style={styles.subtitle}>FREE</Text>
<Animated.View style={[styles.line, { width: lineWidth }]} />
</View>
</Animated.View>
</View>
);
};

const styles = StyleSheet.create({
container1: {
flex: 1,
backgroundColor: '#256',
justifyContent: "center",
alignItems: "center",
},
logoContainer: {
alignItems: 'center',
},
title: {
fontSize: 48,
fontWeight: 'bold',
color: 'orange',
letterSpacing: 5,
textShadowOffset: { width: 0, height: 0 },
textShadowRadius: 12,
},
subtitleContainer: {
flexDirection: 'row',
alignItems: 'center',
},
subtitle: {
fontSize: 18,
color: 'orange',
marginHorizontal: 10,
textShadowOffset: { width: 0, height: 0 },
textShadowRadius: 8,
},
line: {
height: 2,
backgroundColor: 'orange',
},
});

📝 Notes

  • Replace splash.js with above code.
  • Adjust duration and setTimeout for timing.

✨ Done! Your app now has a beautiful splash screen with animation 🎉