React Native Edge-to-Edge Display
react-native-edge-to-edge is a React Native library designed to simplify enabling the edge-to-edge display on Android devices (v6+), allowing app content to flow seamlessly under system bars (status and navigation bars). It aims to provide a consistent user experience with iOS and modern Android design patterns, effectively replacing deprecated methods like `FLAG_FULLSCREEN` for immersive modes. The library is currently at version 1.8.1, actively maintained, and follows React Native's release support policy, supporting the latest and two previous minor series. It sees regular updates, often addressing platform-specific quirks and integrating with new Android themeing. A key differentiator is its straightforward configuration via theme inheritance and a dedicated Expo plugin, offering a robust solution as Android 15+ is expected to enforce edge-to-edge by default.
Common errors
-
Failed to resolve: com.google.android.material:material
cause The native Android dependency `com.google.android.material:material` was missing from the project's Gradle configuration.fixUpgrade `react-native-edge-to-edge` to version `1.8.1` or higher, which includes a fix for this missing dependency. -
System bars (status or navigation) unexpectedly reappear after keyboard dismissal on Android.
cause A bug in older versions caused system bars to become visible again after the soft keyboard was dismissed, particularly on Android API 27.fixUpdate `react-native-edge-to-edge` to version `1.8.0` or later to fix this issue. -
Hidden navigation bar reappears on MIUI devices after backgrounding and foregrounding the app.
cause A specific issue on MIUI where the navigation bar state was not correctly preserved across app lifecycle events.fixUpgrade `react-native-edge-to-edge` to version `1.4.3` or newer to resolve this MIUI-specific bug. -
Status bar remains hidden after app launch, even if it should be visible.
cause An issue where the status bar might not correctly show if the app was started with it initially hidden.fixUpdate `react-native-edge-to-edge` to version `1.6.1` or later to ensure the status bar's visibility is correctly managed upon app start.
Warnings
- breaking Starting with React Native 0.81, consider using the built-in `edgeToEdgeEnabled=true` Gradle property along with `@zoontek/react-native-navigation-bar` instead of this library for edge-to-edge functionality, as it may become the preferred and more integrated approach.
- gotcha Google is expected to mandate that app updates on the Play Store target SDK 35 starting August 31, 2025. Apps targeting SDK 35 will have edge-to-edge display enforced by default on Android 15+, which may affect existing non-edge-to-edge layouts.
- breaking The `StatusBar` component's underlying `FLAG_FULLSCREEN` is deprecated since Android 11. Relying on it for immersive mode can lead to inconsistent behavior on newer Android versions.
- gotcha When setting `androidNavigationBar.barStyle`, it will only take effect if `enforceNavigationBarContrast` is explicitly set to `false` in your theme. This was a fix for an issue where styles were not applied correctly.
Install
-
npm install react-native-edge-to-edge -
yarn add react-native-edge-to-edge -
pnpm add react-native-edge-to-edge
Imports
- SystemBars
const { SystemBars } = require('react-native-edge-to-edge')import { SystemBars } from 'react-native-edge-to-edge' - edgeToEdge
import { edgeToEdge } from 'react-native-edge-to-edge/expo'import edgeToEdge from 'react-native-edge-to-edge/expo'
- setSystemBarStyle, setSystemBarsHidden
import { setSystemBarStyle, setSystemBarsHidden } from 'react-native-edge-to-edge'
Quickstart
import React from 'react';
import { SafeAreaView, Text, View, StyleSheet } from 'react-native';
import { SystemBars } from 'react-native-edge-to-edge';
// Android Theme configuration (in android/app/src/main/res/values/themes.xml or styles.xml):
// <style name="AppTheme" parent="Theme.EdgeToEdge.Material3">
// <!-- Your customizations -->
// </style>
export default function App() {
return (
<View style={styles.container}>
<SystemBars
style="dark-content"
hidden={false}
animated={true}
navigationBarStyle="light-content"
/>
<SafeAreaView style={styles.safeArea}>
<Text style={styles.text}>
Welcome to the Edge-to-Edge React Native App!
</Text>
<Text style={styles.subText}>
Content now flows beautifully beneath system bars.
</Text>
{/* Your main application content goes here */}
</SafeAreaView>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#303030',
},
safeArea: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
paddingHorizontal: 20,
},
text: {
fontSize: 24,
fontWeight: 'bold',
color: '#E0E0E0',
textAlign: 'center',
marginBottom: 10,
},
subText: {
fontSize: 16,
color: '#B0B0B0',
textAlign: 'center',
},
});