React Native Navigation Bar Color Change is a library for change color of navigation/Bottom bar on Android
- React Native >= 0.60.0
- Android Only
$ yarn add @codivoire/react-native-navigation-bar
or
$ npm install @codivoire/react-native-navigation-bar --save
import React from 'react';
import {View, Text, Button} from 'react-native';
import NavigationBar from '@codivoire/react-native-navigation-bar';
export default function App() {
const setNavigationColor = color => {
NavigationBar.changeColor(color);
};
const hideNavigation = () => {
NavigationBar.hide();
};
const showNavigation = () => {
NavigationBar.show();
};
const testSetTranslucent = () => {
NavigationBar.changeColor('translucent', false);
};
const testSetTransparent = () => {
NavigationBar.changeColor('transparent', true);
};
return (
<View
style={{
flex: 1,
justifyContent: 'space-around',
alignContent: 'center',
alignItems: 'center',
backgroundColor: 'cyan',
}}>
<Button title="Set transparent" onPress={testSetTransparent} />
<Button title="Set translucent" onPress={testSetTranslucent} />
<Button
title="Set color red"
onPress={() => {
setNavigationColor('red');
}}
/>
<Button
title="Set color blue"
onPress={() => {
setNavigationColor('blue');
}}
/>
<Button
title="Set color ligth"
onPress={() => {
NavigationBar.changeColor('#ffffff', true);
}}
/>
<Button title="Hide bar" onPress={hideNavigation} />
<Button title="Show bar" onPress={showNavigation} />
<Text>Hello Word!</Text>
</View>
);
}
Change color of Navigation/Bottom bar. color can be a "translucent" | "transparent" | HEX color, or name.
ex: green, blue, #80b3ff, #ffffff....
Light is true? icons will be dark.
import NavigationBar from '@codivoire/react-native-navigation-bar';
NavigationBar.changeColor('#80b3ff');
Hide Navigation Bar
import NavigationBar from '@codivoire/react-native-navigation-bar';
NavigationBar.hide();
Show Navigation Bar
import NavigationBar from '@codivoire/react-native-navigation-bar';
NavigationBar.show();
MIT