NativeWind v5: Themes, Fonts, Design Tokens, and CSS-First Configuration
NativeWind v5 brings full alignment with Tailwind CSS v4 to React Native and Expo applications, introducing a modern, CSS-first configuration workflow. While the utility-first styling experience remains familiar, the methods for configuring themes, fonts, and custom design tokens have fundamentally changed. This guide breaks down how NativeWind v5 works under the hood, details key breaking changes from previous versions, and demonstrates how to build a scalable design system using global.css, @theme directives, semantic colors, and custom fonts.
Table of Contents
1. What's New in NativeWind v5?
2. Installing NativeWind v5
3. NativeWind v5's CSS-First Configuration
4. What is react-native-css?
5. Creating a Custom Theme in NativeWind v5
6. How to Organize global.css
7. Implementing Dark Mode with Semantic Colors
8. NativeWind v5 Best Practices
9. Common NativeWind v5 Mistakes
10. Managing Custom Fonts and Typography
Tested Environment
Last Tested: July 2026
This guide was tested with the following versions:
* Expo SDK: "~56.0.4"
* NativeWind: "preview"
* react-native-css: "latest"
* Tailwind CSS: "^4.1.13"
* @tailwindcss/postcss: "^4.1.13"
* PostCSS: "^8.5.6"
Because NativeWind v5 introduces a new CSS-first architecture, make sure your project uses compatible versions of NativeWind, Tailwind CSS, and Expo before following the setup steps.
What is New in NativeWind v5?
Although you can continue using familiar utility classes like flex-1, p-4, and bg-primary, NativeWind v5 introduces a major architectural overhaul behind the scenes. By adopting Tailwind CSS v4's CSS-first configuration model, theme customization moves out of JavaScript and entirely into global.css via @theme directives.
➤Powered by react-native-css: This engine operates as a high-performance CSS polyfill designed specifically for native runtimes, allowing web-centric CSS syntax to run on iOS and Android.
➤Zero Babel Plugin Dependency: The release completely eliminates the classic NativeWind Babel plugin, which drastically speeds up development build processes and simplifies your tooling configuration.
➤Streamlined Metro Integration: By wrapping your setup in a custom Metro plugin (withNativewind), the new architecture ensures easier codebase maintenance and seamless native performance extensions.
➤Dynamic Runtime Themes: Introduces the new VariableContextProvider component. By hooking into Tailwind v4's CSS variable engine, you can swap colors, fonts, or entire design tokens at runtime without rebuilding the mobile stylesheet.
➤First-Class Platform Variants: Includes built-in native selectors (ios:, android:, native:, web:) right inside global.css, making cross-platform conditional styling cleaner than ever.
How to Install NativeWind v5
Setting up a brand new project with NativeWind v5 is now entirely hands-off. Instead of manually handling dependencies and configuring your bundler, you can bootstrap a pre-configured React Native environment in a single command using the rn-new CLI:
npx rn-new --nativewind
This fully automates the installation of NativeWind v5, hooks up the necessary Metro plugins, and structures your global.css automatically. It turns what used to be a multi-step configuration process into a true zero-config installation.
NativeWind v5's CSS-First Configuration
One of the most significant changes in NativeWind v5 is the fundamental shift from a JavaScript-first setup to a modern, CSS-first workflow. Instead of defining your entire design system inside a bulky tailwind.config.js file, you now configure colors, typography, spacing, and custom design tokens directly inside your global.css file.
This approach natively embraces modern CSS variables, drastically cleans up your root project directory, and fully aligns React Native and Expo projects with the latest design standards of the broader Tailwind CSS ecosystem.
What's react-native-css?
react-native-css is the engine that enables NativeWind v5's CSS-first architecture. It parses your CSS, including @theme variables and custom utilities, and converts them into optimized React Native StyleSheet objects during the build process. This allows NativeWind v5 to align with Tailwind CSS v4 while reducing JavaScript runtime work and simplifying configuration.
Creating a Custom Theme in NativeWind v5
A well-designed theme is the foundation of every scalable application. NativeWind v5 encourages you to define reusable design tokens for colors, typography, spacing, border radius, and other visual properties. Once defined, these tokens automatically generate semantic utility classes such as bg-primary, text-foreground, and rounded-lg, allowing you to style components consistently without hardcoding values throughout your project.
How to Organize global.css
As your application grows, your theme configuration will grow with it. Organizing global.css into logical sections—such as colors, typography, spacing, shadows, and border radius—makes your design system easier to understand and maintain. Keeping all design tokens in a single, well-structured file also simplifies collaboration and future updates.
Defining custom colors in "global.css" is one of the most significant changes introduced in NativeWind v5, but it can also be one of the most confusing aspects for developers migrating from previous versions. Differences in project configuration, tooling, and the new CSS-first workflow can lead to unexpected errors during setup.
A clean production-ready structure inside your global.css layer maps out like this:
/* 1. CORE IMPORTS & LAYERS */
@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/preflight.css" layer(base);
@import "tailwindcss/utilities.css";
@import "nativewind/theme";
/* 2. DESIGN SYSTEM TOKENS */
@theme {
/* Brand Colors */
--color-primary: #3b82f6;
--color-background: #ffffff;
/* Typography */
--font-heading: "Inter-Bold";
--font-body: "Inter-Regular";
/* Spacing & Custom Bounds */
--spacing-app-pad: 16px;
}
Unknown word --color-- primary error
If you encounter errors while defining custom color variables in the "@theme" block, use the following alternative configuration instead. This approach provides the same result while avoiding compatibility issues in some project setups.
@import 'tailwindcss/theme.css' layer(theme);
@import 'tailwindcss/preflight.css' layer(base);
@import 'tailwindcss/utilities.css';
@import 'nativewind/theme';
@theme {
/* 1. Tell Tailwind to generate utility classes matching these tokens */
--color-brand-primary: var(--brand-primary);
--color-brand-dark: var(--brand-dark);
--font-inter: var(--font-inter-file);
--font-inter-bold: var(--font-inter-bold-file);
}
:root {
/* 2. Tell React Native the absolute values assigned to those tokens */
--brand-primary: #3b82f6;
--brand-dark: #1e3a8a;
--font-inter-file: Inter-Regular;
--font-inter-bold-file: Inter-Bold;
}
Keeping all design tokens inside a single, unified file simplifies engineering collaboration, ensures seamless syncs with cross-platform web structures, and drastically streamlines future version upgrades.
Implementing Dark Mode with Semantic Colors
NativeWind v5 makes dark mode easier by encouraging semantic color names instead of hardcoded color values. Rather than styling components with colors like white, black, or blue, you define tokens such as background, foreground, and primary. Components continue using the same utility classes regardless of the active theme, while only the underlying color values change between light and dark modes.
For additional examples of conditional styling, including platform-specific and state-based utility classes, refer to my NativeWind Examples and Reusable Components guide. The concepts covered there are fully compatible with NativeWind v5.
NativeWind v5 Best Practices
Following a few best practices from the beginning will help you build a more maintainable project. Prefer semantic design tokens over hardcoded values, organize your theme consistently, choose meaningful names for colors and typography, and keep your design system simple. These practices make future redesigns, dark mode support, and collaboration much easier.
While this guide focuses on setting up NativeWind v5 and configuring themes, fonts, and CSS variables, the utility classes and reusable component patterns remain the same. For practical examples such as buttons, cards, forms, and layout components, see my NativeWind Examples and Reusable Components guide.
Common NativeWind v5 Mistakes
If you're upgrading from an earlier version, it's easy to carry over outdated configuration patterns. Common mistakes include placing unsupported declarations inside @theme, relying too heavily on tailwind.config.js, or using raw color values instead of semantic tokens. Understanding these differences early will help you avoid configuration issues and adopt the intended NativeWind v5 workflow.
Managing Custom Fonts and Typography in NativeWind v5
Managing custom fonts and typography can become difficult as a React Native application grows. Many developers hardcode "fontFamily" values throughout their components, making it tedious to replace fonts, maintain a consistent visual style, or introduce new typography rules. In larger projects, different screens may use slightly different font names, sizes, or weights, leading to an inconsistent user experience and unnecessary maintenance. NativeWind v5 addresses this challenge by allowing you to define font families as reusable theme variables in "global.css". Once configured, you can apply fonts using semantic utility classes instead of repeating font names, resulting in a more scalable and maintainable typography system.
Just like colors and spacing, custom font families are defined inside the "@theme" block in your "global.css" file. Once declared, NativeWind generates utility classes for these font variables, allowing you to apply consistent typography throughout your React Native application using familiar "font-*" utilities.
/* global.css */
@theme {
--font-sans: "Inter";
--font-heading: "Poppins";
--text-xs: 0.75rem;
--text-sm: 0.875rem;
--text-base: 1rem;
}
<Text className="font-heading text-2xl"> NativeWind v5 </Text>
Conclusion
NativeWind v5 is more than an update—it modernizes how React Native applications are styled by embracing Tailwind CSS v4's CSS-first philosophy. By organizing your project around reusable design tokens, semantic colors, and a centralized global.css file, you can build applications that are easier to maintain, easier to theme, and better prepared for future growth.
For practical examples and reusable UI patterns, see the NativeWind Examples and Reusable Components guide.