Reference version

NavigationBar

A Jetpack Compose NavigationBar component for Material 3 bottom navigation.

Android
Included in Expo Go
Bundled version:
~57.0.1

Expo UI NavigationBar matches the official Jetpack Compose NavigationBar API. It displays a row of destinations for switching between top-level app sections.

Material 3 navigation bar with selectable destinations

Installation

Terminal
npx expo install @expo/ui

If you are installing this in an existing React Native app, make sure to install expo in your project.

Usage

Basic navigation bar

Manage the selected item in React state and pass selected to each NavigationBarItem.

BasicNavigationBar.tsx
import { useState } from 'react'; import { Host, Icon, NavigationBar, NavigationBarItem, Text } from '@expo/ui/jetpack-compose'; const HOME_ICON = require('./assets/home.xml'); const SEARCH_ICON = require('./assets/search.xml'); const SETTINGS_ICON = require('./assets/settings.xml'); export default function BasicNavigationBar() { const [selectedTab, setSelectedTab] = useState('home'); return ( <Host matchContents> <NavigationBar> <NavigationBarItem selected={selectedTab === 'home'} onClick={() => setSelectedTab('home')}> <NavigationBarItem.Icon> <Icon source={HOME_ICON} /> </NavigationBarItem.Icon> <NavigationBarItem.Label> <Text>Home</Text> </NavigationBarItem.Label> </NavigationBarItem> <NavigationBarItem selected={selectedTab === 'search'} onClick={() => setSelectedTab('search')}> <NavigationBarItem.Icon> <Icon source={SEARCH_ICON} /> </NavigationBarItem.Icon> <NavigationBarItem.Label> <Text>Search</Text> </NavigationBarItem.Label> </NavigationBarItem> <NavigationBarItem selected={selectedTab === 'settings'} onClick={() => setSelectedTab('settings')}> <NavigationBarItem.Icon> <Icon source={SETTINGS_ICON} /> </NavigationBarItem.Icon> <NavigationBarItem.Label> <Text>Settings</Text> </NavigationBarItem.Label> </NavigationBarItem> </NavigationBar> </Host> ); }

API

import { NavigationBar, NavigationBarItem } from '@expo/ui/jetpack-compose';

Components

Type: React.Element<NavigationBarProps>

A Material Design 3 navigation bar.

NavigationBarProps

children

Optional • Type: ReactNode

Navigation bar items.

containerColor

Optional • Type: ColorValue • Default: NavigationBarDefaults.containerColor

Background color of the navigation bar.

contentColor

Optional • Type: ColorValue • Default: contentColorFor(containerColor)

Preferred content color inside the navigation bar.

modifiers

Optional • Type: ModifierConfig[]

Modifiers for the component.

tonalElevation

Optional • Type: number • Default: NavigationBarDefaults.Elevation

Tonal elevation in dp.

Type: React.Element<NavigationBarItemProps>

A Material Design 3 navigation bar item. Must be used inside NavigationBar.

NavigationBarItemProps

alwaysShowLabel

Optional • Type: boolean • Default: true

Whether to always show the label.

children

Optional • Type: ReactNode

Children containing Icon, SelectedIcon, and Label slots.

colors

Optional • Type: NavigationBarItemColors

Colors for the item in different states.

enabled

Optional • Type: boolean • Default: true

Whether the item is enabled.

modifiers

Optional • Type: ModifierConfig[]

Modifiers for the component.

onClick

Optional • Type: () => void

Callback that is called when the item is clicked.

selected

Type: boolean

Whether this item is currently selected.

Types

Colors for navigation bar items in different states.

PropertyTypeDescription
disabledIconColor(optional)ColorValue
-
disabledTextColor(optional)ColorValue
-
selectedIconColor(optional)ColorValue
-
selectedIndicatorColor(optional)ColorValue
-
selectedTextColor(optional)ColorValue
-
unselectedIconColor(optional)ColorValue
-
unselectedTextColor(optional)ColorValue
-

Components

Type: React.Element<NavigationBarProps>

A Material Design 3 navigation bar.

NavigationBarProps

children

Optional • Type: ReactNode

Navigation bar items.

containerColor

Optional • Type: ColorValue • Default: NavigationBarDefaults.containerColor

Background color of the navigation bar.

contentColor

Optional • Type: ColorValue • Default: contentColorFor(containerColor)

Preferred content color inside the navigation bar.

modifiers

Optional • Type: ModifierConfig[]

Modifiers for the component.

tonalElevation

Optional • Type: number • Default: NavigationBarDefaults.Elevation

Tonal elevation in dp.

Type: React.Element<NavigationBarItemProps>

A Material Design 3 navigation bar item. Must be used inside NavigationBar.

NavigationBarItemProps

alwaysShowLabel

Optional • Type: boolean • Default: true

Whether to always show the label.

children

Optional • Type: ReactNode

Children containing Icon, SelectedIcon, and Label slots.

colors

Optional • Type: NavigationBarItemColors

Colors for the item in different states.

enabled

Optional • Type: boolean • Default: true

Whether the item is enabled.

modifiers

Optional • Type: ModifierConfig[]

Modifiers for the component.

onClick

Optional • Type: () => void

Callback that is called when the item is clicked.

selected

Type: boolean

Whether this item is currently selected.

Types

Colors for navigation bar items in different states.

PropertyTypeDescription
disabledIconColor(optional)ColorValue
-
disabledTextColor(optional)ColorValue
-
selectedIconColor(optional)ColorValue
-
selectedIndicatorColor(optional)ColorValue
-
selectedTextColor(optional)ColorValue
-
unselectedIconColor(optional)ColorValue
-
unselectedTextColor(optional)ColorValue
-