Last updated on February 21, 2026
Dark Mode
Nativewind v5 supports dark mode through the system preference using the prefers-color-scheme media query. This works automatically with React Native's Appearance API on native and the CSS media query on web.
System Preference (Automatic)
By default, Tailwind CSS's dark: variant uses the system color scheme. No additional configuration is needed:
Under the hood, dark: maps to @media (prefers-color-scheme: dark), which is reactive on both native and web. When the user changes their system theme, styles update automatically.
Manual Selection (User Toggle)
To allow users to manually toggle between light and dark mode, use React Native's Appearance API:
You can read the current color scheme using React Native's useColorScheme hook:
Nativewind v4 provided a custom useColorScheme hook from nativewind. In v5 this is deprecated -- use useColorScheme from react-native and Appearance.setColorScheme() directly instead.
Best Practices
Always provide both light and dark mode styles. React Native can have issues with conditionally applied styles: