Skip to content

Add StatusBar "auto" barStyle value#56978

Closed
zoontek wants to merge 3 commits into
react:mainfrom
zoontek:add-status-bar-auto
Closed

Add StatusBar "auto" barStyle value#56978
zoontek wants to merge 3 commits into
react:mainfrom
zoontek:add-status-bar-auto

Conversation

@zoontek

@zoontek zoontek commented May 27, 2026

Copy link
Copy Markdown
Contributor

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

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 27, 2026
@github-actions

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label May 27, 2026
@meta-codesync

meta-codesync Bot commented May 27, 2026

Copy link
Copy Markdown

@zeyap has imported this pull request. If you are a Meta employee, you can view this in D106535143.

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@zeyap

zeyap commented May 29, 2026

Copy link
Copy Markdown
Contributor

@zoontek landing, but would be good to have some screenshot (from your RNTester test) or a jest e2e test here (cc @cortinico)

@meta-codesync meta-codesync Bot closed this in 61c8b04 May 29, 2026
@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label May 29, 2026
@meta-codesync

meta-codesync Bot commented May 29, 2026

Copy link
Copy Markdown

@zeyap merged this pull request in 61c8b04.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @zoontek in 61c8b04

When will my fix make it into a release? | How to file a pick request?

@zoontek zoontek deleted the add-status-bar-auto branch June 3, 2026 14:34
@zoontek

zoontek commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

@zeyap Here it is:

Screenshot 2026-06-03 at 16 46 15 Screenshot 2026-06-03 at 16 44 54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants