Skip to content

Commit 599a74f

Browse files
authored
docs: add missing information about status bar props (#2953)
## Description Add information about supported values for `statusBarStyle` and `statusBarAnimation`. Similar PR in `react-navigation`: react-navigation/react-navigation#12618, `react-navigation.github.io`: react-navigation/react-navigation.github.io#1432. ## Changes - add information about `auto` and `inverted` not being supported for `statusBarStyle` on Android - add information about `light` being default value for `statusBarStyle` on Android - add information about `statusBarAnimation` default values and differences in behavior between Android and iOS - fix missing parenthesis ## Checklist - [x] Updated TS types - [x] Updated documentation: <!-- For adding new props to native-stack --> - [x] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [x] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx
1 parent 5fcb545 commit 599a74f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

guides/GUIDE_FOR_LIBRARY_AUTHORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ Defaults to `false`.
289289

290290
### `statusBarStyle`
291291

292-
Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file. On iOS, the possible values are: `auto` (based on [user interface style](https://developer.apple.com/documentation/uikit/uiuserinterfacestyle?language=objc), `inverted` (colors opposite to `auto`), `light`, `dark`. On Android, the status bar will be dark if set to `dark` and `light` otherwise.
292+
Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file. On iOS, the possible values are: `auto` (based on [user interface style](https://developer.apple.com/documentation/uikit/uiuserinterfacestyle?language=objc)), `inverted` (colors opposite to `auto`), `light`, `dark`. On Android, the status bar will be dark if set to `dark` and `light` otherwise.
293293

294294
Defaults to `auto`.
295295

src/types.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,11 @@ export interface ScreenProps extends ViewProps {
430430
*/
431431
stackPresentation?: StackPresentationTypes;
432432
/**
433-
* Sets the status bar animation (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS.
433+
* Sets the status bar animation (similar to the `StatusBar` component).
434+
* On Android, setting either `fade` or `slide` will set the transition of status bar color. On iOS, this option applies to appereance animation of the status bar.
435+
* Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS.
436+
*
437+
* Defaults to `fade` on iOS and `none` on Android.
434438
*/
435439
statusBarAnimation?: 'none' | 'fade' | 'slide';
436440
/**
@@ -449,7 +453,9 @@ export interface ScreenProps extends ViewProps {
449453
*/
450454
statusBarHidden?: boolean;
451455
/**
452-
* Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS. Defaults to `auto`.
456+
* Sets the status bar color (similar to the `StatusBar` component). Requires enabling (or deleting) `View controller-based status bar appearance` in your Info.plist file on iOS.
457+
* `auto` and `inverted` are supported only on iOS. On Android, they will fallback to `light`.
458+
* Defaults to `auto` on iOS and `light` on Android.
453459
*/
454460
statusBarStyle?: 'inverted' | 'auto' | 'light' | 'dark';
455461
/**

0 commit comments

Comments
 (0)