Reference version

This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.

Expo StatusBar iconExpo StatusBar

A library that provides the same interface as the React Native StatusBar API, but with slightly different defaults to work great in Expo environments.

Android
iOS
tvOS
Web
Included in Expo Go

expo-status-bar gives you a component and imperative interface to control the app status bar to change its text color, hide it, and apply animations to any of these changes. Exactly what you are able to do with the StatusBar component depends on the platform you're using.

Installation

Terminal
- npx expo install expo-status-bar
- yarn expo install expo-status-bar
- pnpm expo install expo-status-bar
- bun expo install expo-status-bar

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

Configuration in app config

You can configure expo-status-bar using its built-in config plugin if you use config plugins in your project (Continuous Native Generation (CNG)). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect. If your app does not use CNG, then you'll need to manually configure the library.

Example app.json with config plugin

app.json
{ "expo": { "plugins": [ [ "expo-status-bar", { "hidden": false, "style": "dark" } ] ] } }

Configurable properties

NameDefaultDescription
hiddenundefined

Determines whether the status bar starts hidden. Accepts true and false as values.

styleundefined

Determines which style the status bar starts with. Accepts light and dark as values.

Are you using this library in an existing React Native app?

If you're not using Continuous Native Generation (CNG) or you're using a native project manually, then you need to add the following configuration to your native project:

  • To hide the status bar on Android, add expoStatusBarHidden to android/app/src/main/res/values/styles.xml:

    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> <!-- ... --> <item name="expoStatusBarHidden">true</item> </style>
  • To hide the status bar on iOS, set the following keys in your ios/<project>/Info.plist:

    <key>UIStatusBarHidden</key> <true/>

Usage

Example
import { StyleSheet, Text, View } from 'react-native'; import { StatusBar } from 'expo-status-bar'; export default function App() { return ( <View style={styles.container}> <Text style={styles.text}>Notice that the status bar has light text!</Text> <StatusBar style="light" /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#000', alignItems: 'center', justifyContent: 'center', }, text: { color: '#fff', }, });

Vertical bar on iPhone Duo

iPhone Duo defaults to placing the status bar in a vertical bar beside your content instead of along the top. Use useVerticalBarEdgeIOS to find which edge the vertical bar is on, for example to keep custom controls clear of it. It returns 'leading', 'trailing', or null. On devices and in orientations without a vertical bar (including iPhone Duo), it returns null. The value updates when the device rotates or unfolds.

import { useVerticalBarEdgeIOS } from 'expo-status-bar'; export default function Screen() { const verticalBarEdge = useVerticalBarEdgeIOS(); // 'leading' | 'trailing' | null }

To keep the status bar and other system bars horizontal, set verticalBarBehaviorIOS="disabled" on a mounted StatusBar. Reserve this for screens that work better with horizontal bars, such as a full-screen video player. The edge that useVerticalBarEdgeIOS reports stays the same while the vertical bar is disabled.

<StatusBar verticalBarBehaviorIOS="disabled" />

When several mounted StatusBar components set this prop, the most recently mounted one applies.

API

import { StatusBar } from 'expo-status-bar';

Component

StatusBar

Android
iOS
tvOS
Web

Type: React.Element<StatusBarProps>

A component that allows you to configure your status bar declaratively.

You will likely have multiple StatusBar components mounted in the same app at the same time. For example, if you have multiple screens in your app, you may end up using one per screen. The props of each StatusBar component will be merged in the order that they were mounted. This component is built on top of the StatusBar component exported from React Native, and it provides defaults that work better for Expo users.

StatusBarProps

animated

Android
iOS
tvOS
Web
Optional • Type: boolean

If the transition between status bar property changes should be animated. Supported for style and hidden.

hidden

Android
iOS
tvOS
Web
Optional • Type: boolean

If the status bar is hidden. Has no effect on iPhone Duo, where the status bar is in a vertical bar. Use verticalBarBehaviorIOS to move it back to the top.

hideTransitionAnimation

iOS
Optional • Type: StatusBarAnimation • Default: 'fade'

The transition effect when showing and hiding the status bar using the hidden prop.

style

Android
iOS
tvOS
Web
Optional • Type: StatusBarStyle • Default: 'auto'

Sets the color of the status bar text. Default value is "auto" which picks the appropriate value according to the active color scheme, eg: if your app is dark mode, the style will be "light".

verticalBarBehaviorIOS

iOS
Optional • Type: VerticalBarBehaviorIOS • Default: 'automatic'

Whether the system may move the status bar into a vertical bar beside the content, as on iPhone Duo. 'disabled' keeps the status bar and system bars horizontal while this component is mounted. When several mounted StatusBar components set this prop, the most recently mounted one applies. Requires iOS 27.1 or later.

Component methods

getVerticalBarEdgeIOS()

iOS

Get the edge where the system places the vertical bar, such as the side rail on iPhone Duo. The edge stays the same while verticalBarBehaviorIOS is 'disabled'.

Returns:
VerticalBarEdgeIOS | null

The edge of the vertical bar, or null when the system places no vertical bar, such as on other devices, in orientations that keep the status bar at the top, or before iOS 27.1.

Example

StatusBar.getVerticalBarEdgeIOS(); // 'trailing' on iPhone Duo

setHidden(hidden, animation)

Android
iOS
tvOS
Web
ParameterTypeDescription
hiddenboolean

If the status bar should be hidden.

animation(optional)StatusBarAnimation

Animation to use when toggling hidden, defaults to 'none'.


Toggle visibility of the status bar. Has no effect on iPhone Duo, where the status bar is in a vertical bar. Use verticalBarBehaviorIOS to move it back to the top.

Returns:
void

Example

StatusBar.setHidden(true, 'slide');

setStyle(style, animated)

Android
iOS
tvOS
Web
ParameterTypeDescription
styleStatusBarStyle

The color of the status bar text.

animated(optional)boolean

If the transition should be animated.


Set the bar style of the status bar.

Returns:
void

Example

StatusBar.setStyle('dark', true);

setVerticalBarBehaviorIOS(behavior)

iOS
ParameterTypeDescription
behaviorVerticalBarBehaviorIOS

'disabled' keeps the status bar and system bars horizontal.


Set whether the system may move the status bar into a vertical bar beside the content, as on iPhone Duo. Requires iOS 27.1 or later. A mounted StatusBar that sets verticalBarBehaviorIOS takes priority over this value.

Returns:
void

Example

StatusBar.setVerticalBarBehaviorIOS('disabled');

Hooks

useVerticalBarEdgeIOS()

iOS

A hook that returns the edge where the system places the vertical bar, and updates when it changes, such as when the device rotates. See StatusBar.getVerticalBarEdgeIOS().

Returns:
VerticalBarEdgeIOS | null

Methods

StatusBar.setStatusBarHidden(hidden, animation)

Android
iOS
tvOS
Web
ParameterTypeDescription
hiddenboolean

If the status bar should be hidden.

animation(optional)StatusBarAnimation

Animation to use when toggling hidden, defaults to 'none'.


Returns:
void

StatusBar.setStatusBarStyle(style, animated)

Android
iOS
tvOS
Web
ParameterTypeDescription
styleStatusBarStyle

The color of the status bar text.

animated(optional)boolean

If the transition should be animated.


Returns:
void

Types

StatusBarAnimation

Android
iOS
tvOS
Web

Literal type: string

Acceptable values are: 'none' | 'fade' | 'slide'

StatusBarStyle

Android
iOS
tvOS
Web

Literal type: string

Acceptable values are: 'auto' | 'inverted' | 'light' | 'dark'

VerticalBarBehaviorIOS

iOS

Literal type: string

Whether the system may place the status bar in a vertical bar. 'disabled' keeps the status bar and system bars horizontal.

Acceptable values are: 'automatic' | 'disabled'

VerticalBarEdgeIOS

iOS

Literal type: string

The edge where the system places the vertical bar, which holds the status bar beside the content on devices such as iPhone Duo.

Acceptable values are: 'leading' | 'trailing'