Expo SystemUI
A library that allows interacting with system UI elements.
For the complete documentation index, see llms.txt. Use this Use this file to discover all available pages.
expo-system-ui enables you to interact with UI elements that fall outside of the React tree. Specifically the root view background color, and locking the user interface style globally on Android.
Installation
- npx expo install expo-system-uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
API
import * as SystemUI from 'expo-system-ui';
Methods
Gets the root view background color.
Promise<ColorValue | null>Current root view background color in hex format. Returns null if the background color is not set.
Example
const color = await SystemUI.getBackgroundColorAsync();
| Parameter | Type | Description |
|---|---|---|
| color | null | ColorValue | Any valid CSS 3 (SVG) color. |
Changes the root view background color. Call this function in the root file outside of your component.
Promise<void>Example
SystemUI.setBackgroundColorAsync("black");