Skip to main content

expo-status-bar

Version: 55.0.3 Provides the same interface as React Native’s StatusBar API, but with better defaults for Expo environments and automatic edge-to-edge support.

Installation

Usage

API Reference

StatusBar Component

'auto' | 'inverted' | 'light' | 'dark'
default:"auto"
Sets the color scheme of the status bar
  • auto: Automatically picks based on app color scheme
  • inverted: Opposite of the app color scheme
  • light: White text/icons (for dark backgrounds)
  • dark: Dark text/icons (for light backgrounds)
string
Android only: Background color of the status bar
boolean
Android only: Makes status bar translucent
boolean
Hides the status bar
boolean
iOS only: Shows network activity indicator
boolean
Animates status bar changes

Imperative API

(style: StatusBarStyle, animated?: boolean) => void
Sets the status bar style imperatively
(color: string, animated?: boolean) => void
Android only: Sets status bar background color
(hidden: boolean, animation?: 'none' | 'fade' | 'slide') => void
Shows or hides the status bar
(translucent: boolean) => void
Android only: Sets status bar translucency
(visible: boolean) => void
iOS only: Shows/hides network activity indicator

Examples

Basic Usage

Auto Style Based on Theme

Screen-Specific Status Bar

Android Translucent Status Bar

Hide Status Bar

Network Activity Indicator (iOS)

Imperative Control

With React Navigation

Conditional Styling

TypeScript

Platform Support

Differences from React Native StatusBar

  1. Better Defaults: style="auto" automatically adapts to color scheme
  2. Edge-to-Edge Support: Works correctly with Android edge-to-edge mode
  3. Simplified API: Easier to use in Expo projects
  4. TypeScript: Better type definitions

Best Practices

  1. Use “auto” Style: Let the component automatically adapt to theme
  2. One Per Screen: Place one <StatusBar /> per screen/route
  3. Match Background: Status bar style should match screen background
  4. Test Both Themes: Test your app in both light and dark modes
  5. Consider Safe Area: Use with react-native-safe-area-context for proper spacing

Resources