Appearance

The Appearance module exposes information about the user’s appearance preferences, such as their preferred color scheme (light or dark).

import { Appearance } from 'react-native';

API #

Static methods #

getColorScheme () => ("dark" | "light")

You can use the Appearance module to determine if the user prefers a dark color scheme. Although the color scheme is available immediately, this may change (e.g. scheduled color scheme change at sunrise or sunset). Any rendering logic or styles that depend on the user preferred color scheme should try to call this function on every render, rather than caching the value.

Updated
Edit
React Native for WebCopyright © Nicolas Gallagher and Facebook Inc.