SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 153 C++

Add StatusBar "auto" barStyle value (#56978)

Summary:
Adds support for `barStyle="auto"` on `StatusBar`. When set, the bar style is resolved against the current color scheme: `light-content` in dark mode, `dark-content` in light mode. The resolution re-runs when the system color scheme changes, while at least one `StatusBar` is mounted.

The behavior mirrors what `expo-status-bar` already exposes. The `'auto'` name is the one we use at Expo. It is not necessarily the right name for React Native core, happy to switch to something else if reviewers prefer.

## Changelog:

[GENERAL] [ADDED] - StatusBar: support `barStyle="auto"` to follow the current color scheme

Pull Request resolved: https://github.com/facebook/react-native/pull/56978

Test Plan:
- `yarn jest packages/react-native/Libraries/Components/StatusBar` passes, including a new test that asserts `setBarStyle('auto')` calls the native module with `dark-content` in light mode and `light-content` in dark mode.
- Play with it in the RNTester app

Reviewed By: cortinico

Differential Revision: D106535143

Pulled By: zeyap

fbshipit-source-id: eff3dea37a317f22af3364345d355908104c8c5a
M
Mathieu Acthernoene committed
61c8b040bf76bd909965dfb98b2c0bd2aa8e7475
Parent: 833144f
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 5/29/2026, 9:13:06 PM