React Native · Components
SystemBars
Sets the bars declaratively.
Import
SystemBars
componentSets the bars declaratively. Put it inside a screen: it applies while the screen is open, and the previous setting returns when it closes. If several are mounted the last mounted wins (field by field). "auto" follows the app theme (UIProvider).
On Android and iOS the app draws edge-to-edge; the bar background is the content itself. To keep content out from under the bars use the safe area (@yasinsensoy/native/safe-area).
resolveSystemBars
functionMerges the layers: the field given by the upper layer wins.
setSystemBars
functionSets the bars imperatively (the base layer). Mounted <SystemBars> components override it in the fields they give.
SystemBarStyle
typeColor of the bar icons:
"light": light (white) icons; for a dark background."dark": dark icons; for a light background."auto": by the app theme (UIProvider; otherwise the system theme); light icons in the dark theme.
PerBar
typeOne value or a separate value per bar.
SystemBarsProps
interfaceSetting of SystemBars and setSystemBars.
| Name | Type | Description |
|---|---|---|
style? | PerBar<SystemBarStyle> | Icon color. |
hidden? | PerBar<boolean> | Hide. On Android a hidden bar appears temporarily when swiping from the edge; on iOS the navigation bar's counterpart is the home indicator (it fades after a while). |
ResolvedSystemBars
interfaceResolved state sent to the native side.
| Name | Type | Description |
|---|---|---|
statusBarStyle | "light" | "dark" | Status bar icon color. |
navigationBarStyle | "light" | "dark" | Navigation bar icon color. |
statusBarHidden | boolean | Whether the status bar is hidden. |
navigationBarHidden | boolean | Whether the navigation bar is hidden. |
SystemBarsLayer
interfaceOne <SystemBars> layer.
| Name | Type | Description |
|---|---|---|
props | SystemBarsProps | Props of the layer. |
scheme | "light" | "dark" | undefined | Theme used to resolve "auto". |