This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 58).
Expo 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.
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.
tvOS and web support
For tvOS, the
expo-status-barcode will compile and run, but no status bar will show.For web, there is no API available to control the operating system's status bar, so
expo-status-barwill do nothing and won't throw an error.
Installation
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
Configurable properties
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
expoStatusBarHiddento 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
Vertical bar on iPhone Duo
The vertical bar APIs need iOS 27.1 or later and a build made with Xcode 27.1 or later. On older builds and systems,
useVerticalBarEdgeIOSreturnsnullandverticalBarBehaviorIOShas no effect.
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
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.
booleanIf the transition between status bar property changes should be
animated. Supported for style and hidden.
booleanIf 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.
StatusBarAnimation • Default: 'fade'The transition effect when showing and hiding the status bar using the hidden prop.
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 • 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
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'.
VerticalBarEdgeIOS | nullThe 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
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.
voidExample
StatusBar.setHidden(true, 'slide');
Set the bar style of the status bar.
voidExample
StatusBar.setStyle('dark', true);
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.
voidExample
StatusBar.setVerticalBarBehaviorIOS('disabled');
Hooks
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().
VerticalBarEdgeIOS | nullMethods
Deprecated: Use
StatusBar.setHiddeninstead. This will be removed in a future release.
voidDeprecated: Use
StatusBar.setStyleinstead. This will be removed in a future release.
voidTypes
Literal type: string
Acceptable values are: 'none' | 'fade' | 'slide'
Literal type: string
Acceptable values are: 'auto' | 'inverted' | 'light' | 'dark'
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'