StatusBar

Component to control the app status bar.

It is possible to have multiple StatusBar components mounted at the same time. The props will be merged in the order the StatusBar components were mounted.
<View>
  <StatusBar backgroundColor="blue" barStyle="light-content" />
  <View>
    <StatusBar hidden={route.statusBarHidden} />
    ...
  </View>
</View>

For cases where using a component is not ideal, there is also an imperative API exposed as static functions on the component. It is however not recommended to use the static API and the component for the same prop because any value set by the static API will get overridden by the one set by the component in the next render.

Reference

currentHeight (Android only) The height of the status bar.

If the transition between status bar property changes should be animated. Supported for backgroundColor, barStyle and hidden.
TypeRequired
boolNo

The background color of the status bar.
TypeRequiredPlatform
colorNoAndroid

Sets the color of the status bar text.
TypeRequired
enum('default', 'light-content', 'dark-content')No

If the status bar is hidden.
TypeRequired
boolNo

If the network activity indicator should be visible.
TypeRequiredPlatform
boolNoiOS

The transition effect when showing and hiding the status bar using the hidden prop. Defaults to 'fade'.
TypeRequiredPlatform
enum('fade', 'slide')NoiOS

If the status bar is translucent. When translucent is set to true, the app will draw under the status bar. This is useful when using a semi transparent status bar color.
TypeRequiredPlatform
boolNoAndroid

static popStackEntry(entry: any)

Get and remove the last StatusBar entry from the stack.
Parameters:
NameTypeRequiredDescription
entryanyYesEntry returned from pushStackEntry.

static pushStackEntry(props: any)

Push a StatusBar entry onto the stack. The return value should be passed to popStackEntry when complete.
Parameters:
NameTypeRequiredDescription
propsanyYesObject containing the StatusBar props to use in the stack entry.

static replaceStackEntry(entry: any, props: any)

Replace an existing StatusBar stack entry with new props.
Parameters:
NameTypeRequiredDescription
entryanyYesEntry returned from pushStackEntry to replace.
propsanyYesObject containing the StatusBar props to use in the replacement stack entry.

static setBackgroundColor(color: string, [animated]: boolean)

Set the background color for the status bar. Android-only
Parameters:
NameTypeRequiredDescription
colorstringYesBackground color.
animatedbooleanNoAnimate the style change.

static setBarStyle(style: StatusBarStyle, [animated]: boolean)

Set the status bar style
Parameters:
NameTypeRequiredDescription
styleStatusBarStyleYesStatus bar style to set
animatedbooleanNoAnimate the style change.

static setHidden(hidden: boolean, [animation]: StatusBarAnimation)

Show or hide the status bar
Parameters:
NameTypeRequiredDescription
hiddenbooleanYesHide the status bar.
animationStatusBarAnimationNoOptional animation when changing the status bar hidden property.

static setNetworkActivityIndicatorVisible(visible: boolean)

Control the visibility of the network activity indicator. iOS-only.
Parameters:
NameTypeRequiredDescription
visiblebooleanYesShow the indicator.

static setTranslucent(translucent: boolean)

Control the translucency of the status bar. Android-only.
Parameters:
NameTypeRequiredDescription
translucentbooleanYesSet as translucent.

Status bar animation
Type
\$Enum
Constants:
ValueDescription
noneNo animation
fadeFade animation
slideSlide animation

Status bar style
Type
\$Enum
Constants:
ValueDescription
defaultDefault status bar style (dark for iOS, light for Android)
light-contentDark background, white texts and icons
dark-contentLight background, dark texts and icons (requires API>=23 on Android)