Skip to main content

BottomTabNavigation

The BottomTabNavigation component in our library is a navigational element typically placed at the bottom of the screen in mobile applications. It provides users with quick access to different sections or views of the app, enhancing navigation efficiency. Each tab represents a specific category or feature, and users can switch between tabs to access different parts of the application seamlessly. BottomTabNavigation promotes intuitive exploration of app content and functionality, offering a consistent and familiar navigation pattern across screens.

Usage

Basic usage

import {View} from 'react-native';

import {BottomTabNavigation} from 'rn-inkpad';

const MyComponent = () => {
return (
<View style={{flex: 1}}>
<BottomTabNavigation />
</View>
);
};

Props

NameTypeDefaultDescription
backgroundColorstring#FFFFFFBackground color.
highlightedBgColorstring#DB504ABackground color of a highlighted element.
highlightedIconColorstringIcon color of a highlighted element.
iconColorstringTab icon color.
iconSizenumber25Tab icon size.
labelStyleStyleProp<TextStyle>Custom styles for labels.
selectedColorstring#DB504AColor of the indicator of a selected tab.
selectedheightnumber5Height of the indicator of a selected tab.
selectedIndexnumberSelected index.
textColorstringLabel color.
valuesNavigationItem[][{icon: 'home', text: 'Home'}]Array of each of the tabs.
NameTypeRequiredDescription
highlightedbooleanNOActivate element highlighting.
iconstringNOTab icon.
textstringNOTab label.
onPress() => voidNOCallback that is called when tab is pressed.
Information

This navigation only provides the style for your navigation, however to navigate to different screens you must install a navigation package.

Usage with props

import {View} from 'react-native';

import {BottomTabNavigation} from 'rn-inkpad';

const MyComponent = () => {
return (
<View style={{flex: 1}}>
<BottomTabNavigation
selectedIndex={0}
highlightedIconColor="#FFF"
values={[
{icon: 'home', text: 'Home', onPress: () => console.log('Home')},
{
icon: 'search',
text: 'Search',
onPress: () => console.log('Search'),
},
{
icon: 'add',
text: 'Add',
highlighted: true,
onPress: () => console.log('Add'),
},
{
icon: 'notifications',
text: 'Alerts',
onPress: () => console.log('Alerts'),
},
{
icon: 'cog',
text: 'Settings',
onPress: () => console.log('Settings'),
},
]}
/>
</View>
);
};

Example with props