Skip to main content
Version: v2

Dark Mode

NativeWind includes a dark variant that lets you style your site differently when dark mode is enabled

By default this uses Appearance.getColorScheme() on native and prefers-color-scheme on web.


Expo apps do not follow the system appearance unless userInterfaceStyle is set to automatic. Please see the Expo docs for more information.

Toggling dark mode manually

The dark: variant is controlled by the useColorScheme() hook.


To manualy toggle dark mode on web, you will need to enable the class strategy. This is all you need to do, we implement the logic to support both system preference and manual selection

// tailwind.config.js

module.exports = {
darkMode: 'class',
// ...