See how Capacitor fits into the entire Ionic Ecosystem ->
Capacitor is part of the Ionic Ecosystem ->

@capacitor/status-bar

The StatusBar API Provides methods for configuring the style of the Status Bar, along with showing or hiding it.

Install

npm install @capacitor/status-bar
npx cap sync

API

setStyle(…)

setStyle(options: StatusBarStyleOptions) => Promise<void>

Set the current style of the status bar.

Param Type
options StatusBarStyleOptions

Since: 1.0.0


setBackgroundColor(…)

setBackgroundColor(options: StatusBarBackgroundColorOptions) => Promise<void>

Set the background color of the status bar.

This method is only supported on Android.

Param Type
options StatusBarBackgroundColorOptions

Since: 1.0.0


show(…)

show(options?: StatusBarAnimationOptions | undefined) => Promise<void>

Show the status bar.

Param Type
options StatusBarAnimationOptions

Since: 1.0.0


hide(…)

hide(options?: StatusBarAnimationOptions | undefined) => Promise<void>

Hide the status bar.

Param Type
options StatusBarAnimationOptions

Since: 1.0.0


getInfo()

getInfo() => Promise<StatusBarInfoResult>

Get info about the current state of the status bar.

Returns: Promise<StatusBarInfoResult>

Since: 1.0.0


setOverlaysWebView(…)

setOverlaysWebView(options: StatusBarOverlaysWebviewOptions) => Promise<void>

Set whether or not the status bar should overlay the webview to allow usage of the space underneath it.

This method is only supported on Android.

Param Type
options StatusBarOverlaysWebviewOptions

Since: 1.0.0


Interfaces

StatusBarStyleOptions

Prop Type Description Since
style StatusBarStyle Style of the text of the status bar. 1.0.0

StatusBarBackgroundColorOptions

Prop Type Description Since
color string A hex color to which the status bar color is set. This option is only supported on Android. 1.0.0

StatusBarAnimationOptions

Prop Type Description Since
animation StatusBarAnimation The type of status bar animation used when showing or hiding. This option is only supported on iOS. 1.0.0

StatusBarInfoResult

Prop Type Description Since
visible boolean Whether the status bar is visible or not. 1.0.0
style StatusBarStyle The current status bar style. 1.0.0
color string The current status bar color. This option is only supported on Android. 1.0.0
overlays boolean Whether the statusbar is overlaid or not. This option is only supported on Android. 1.0.0

StatusBarOverlaysWebviewOptions

Prop Type Description Since
overlay boolean Whether to overlay the status bar or not. 1.0.0

Enums

StatusBarStyle

Members Value Description Since
Dark 'DARK' Light text for dark backgrounds. 1.0.0
Light 'LIGHT' Dark text for light backgrounds. 1.0.0
Default 'DEFAULT' On iOS 13 and newer the style is based on the device appearance. If the device is using Dark mode, the statusbar text will be light. If the device is using Light mode, the statusbar text will be dark. On iOS 12 and older the statusbar text will be dark. On Android the default will be the one the app was launched with. 1.0.0

StatusBarAnimation

Members Value Description Since
None 'NONE' No animation during show/hide. 1.0.0
Slide 'SLIDE' Slide animation during show/hide. 1.0.0
Fade 'FADE' Fade animation during show/hide. 1.0.0
Previous
<- Share
Next
Storage ->