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 schemeinverted: Opposite of the app color schemelight: 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
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
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
- Better Defaults:
style="auto"automatically adapts to color scheme - Edge-to-Edge Support: Works correctly with Android edge-to-edge mode
- Simplified API: Easier to use in Expo projects
- TypeScript: Better type definitions
Best Practices
- Use “auto” Style: Let the component automatically adapt to theme
- One Per Screen: Place one
<StatusBar />per screen/route - Match Background: Status bar style should match screen background
- Test Both Themes: Test your app in both light and dark modes
- Consider Safe Area: Use with
react-native-safe-area-contextfor proper spacing