rn-edge-to-edge
v1.0.0
Published
React-native - apply 'Edge-to-edge' mode for android platform
Downloads
317
Readme
rn-edge-to-edge
ReactNative - apply 'Edge-to-edge' mode for android platform
Installation
npm install rn-edge-to-edge
Setup
Android
- Add inside your
android/app/src/main/java/com/yourprojectname/MainActivity.{java,kt}
file:
import androidx.activity.enableEdgeToEdge
class MainActivity: ReactActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
...
enableEdgeToEdge()
super.onCreate(null);
}
...
}
Usage
import { StatusBar } from 'rn-edge-to-edge';
// ...
return (
<NavigationContainer
linking={platformLinking}
theme={Theme}
onReady={isReadyCallback}>
<StatusBar
barStyle='dark-content'
backgroundColor='#ff007c'
/>
<RootStack />
</NavigationContainer>
);
Props
barStyle: "light-content" | "dark-content";
animated = boolean
backgroundColor = ColorValue | null
ℹ️ If you using prop "backgroundColor" equal to "null", the navigationBar will be transparent
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library