React Native Edge-to-Edge Display

1.8.1 · active · verified Tue Apr 21

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

Warnings

Install

Imports

Quickstart

Demonstrates enabling edge-to-edge display by updating the Android theme and using the `SystemBars` component to control status and navigation bar appearance within a React Native application.

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',
  },
});

view raw JSON →