Setup with Expo
masterTo use react-native-bootsplash with Expo:
- Uninstall
expo-splash-screenfrom your project. - Add the
react-native-bootsplashplugin to your Expo configuration.
Note: If you have a license key, pass it via the BOOTSPLASH_LICENSE_KEY environment variable.
Plugin Options:
logo(string, required): Logo file path (PNG or SVG).logoWidth(number): Logo width at @1x in dp. Default100.background(string): Hexadecimal background color. Default#fff.assetsOutput(string): Assets output directory. Defaultassets/bootsplash.brand(string): Brand file path.brandWidth(number): Brand width at @1x. Default80.darkBackground(string): Dark mode background color.darkLogo(string): Dark mode logo file path.darkBrand(string): Dark mode brand file path.android.darkContentBarsStyle(boolean): Enforce system bars style.
// Dynamic configuration (app.config.js or app.config.ts)
import type { ConfigContext, ExpoConfig } from "expo/config";
import bootsplash from "react-native-bootsplash/expo";
export default ({ config }: ConfigContext): ExpoConfig => ({
// …
platforms: ["android", "ios", "web"], // must be explicit
plugins: [
bootsplash({
logo: "./assets/logo.png",
logoWidth: 100,
background: "#f5fcff",
}),
],
});