react-native-navigation-bar-manager
v1.0.3
Published
A React Native module for Android that allows you to customize the navigation bar's color, theme, visibility, and button functionality with ease.
Maintainers
Readme
React Native Navigation Bar Manager
A React Native module for Android that allows you to customize the navigation bar's color, theme, visibility, and button functionality with ease.
Installation
To install the package, use one of the following commands:
npm install react-native-navigation-bar-manager
import NavigationBar from 'rn-navigation-bar';
// Change the navigation bar color
NavigationBar.setColor('#FF5733');
// Set the navigation bar theme to dark
NavigationBar.setBarTheme('dark');
// Show or hide the navigation bar
NavigationBar.setVisible(false);
// Disable the navigation bar buttons for immersive mode
NavigationBar.setButtonEnabled(false);
Example Usage
Here’s a full example of how to use the module:
import React from 'react';
import { View, Button } from 'react-native';
import NavigationBar from 'rn-navigation-bar';
const App = () => {
const changeColor = () => {
NavigationBar.setColor('#00FF00');
};
const toggleTheme = () => {
NavigationBar.setBarTheme('light');
};
const toggleVisibility = () => {
NavigationBar.setVisible(false);
};
const disableButtons = () => {
NavigationBar.setButtonEnabled(false);
};
return (
<View>
<Button title="Change Color" onPress={changeColor} />
<Button title="Set Light Theme" onPress={toggleTheme} />
<Button title="Hide Navigation Bar" onPress={toggleVisibility} />
<Button title="Disable Buttons" onPress={disableButtons} />
</View>
);
};
export default App;