Key Differences
Before starting the migration, it’s important to understand how Uniwind differs from Nativewind:Uniwind supports Tailwind 4 only. Make sure you upgrade Tailwind CSS to version 4.
- Default rem value: Uniwind uses
16pxas the default value for theremunit - No global overrides: We don’t override global components like Nativewind’s
cssInterop - CSS-based theming: Themes are defined in CSS files instead of
tailwind.config.js - No ThemeProvider required: Uniwind doesn’t require wrapping your app in a
ThemeProviderto switch themes
Prerequisites
Nativewind depends on the following packages:react-native-reanimatedreact-native-safe-area-contexttailwindcss
We recommend keeping both
react-native-reanimated and react-native-safe-area-context in your project, as they are very useful for React Native development.Migration Steps
Step 1: Install Uniwind
Follow the Quickstart guide to install Uniwind in your project.Step 2: Remove Nativewind Babel preset
Remove the Nativewind Babel preset from yourbabel.config.js file:
babel.config.js
Step 3: Update Metro configuration
Modify yourmetro.config.js to remove the Nativewind configuration and use Uniwind’s configuration instead:
metro.config.js
Learn more about Metro configuration in the Metro Config documentation.
Step 4: Update your global CSS file
Replace the top of yourglobal.css file with the following imports:
global.css
Step 5: Remove Nativewind type definitions
Delete thenativewind.d.ts file from your project, as it’s no longer needed.
Step 6: Convert your CSS to Tailwind 4 syntax
You can keep most of your existing CSS as-is, but you’ll need to follow Tailwind 4’s@theme syntax for theme configuration.
Step 7: Migrate theme variables from JavaScript to CSS
If you defined custom theme variables using Nativewind’svars helper:
Before: JavaScript theme configuration
Before: JavaScript theme configuration
vars.ts
After: CSS theme configuration
After: CSS theme configuration
Move these variables directly to your
global.css file:global.css
If you need to access CSS variables in JavaScript, you can use
useResolveClassNames hook.Step 8: Remove tailwind.config.js
With Uniwind, you no longer need atailwind.config.js file. Theme configuration is now done entirely in CSS.
Example: Old tailwind.config.js
Example: Old tailwind.config.js
tailwind.config.js
Step 9: (Optional) Customize the default rem value
If you want to keep Nativewind’s defaultrem value of 14px, configure it in your metro.config.js:
metro.config.js
Step 10: Remove ThemeContext where you set colorScheme
Uniwind doesn’t require a ThemeProvider to manage themes. Simply remove it from your app:
Before: With ThemeProvider
Before: With ThemeProvider
ThemeProvider.tsx
App.tsx
After: Without ThemeProvider
After: Without ThemeProvider
App.tsx
Step 11: Replace cssInterop with withUniwind
If you’re using Nativewind’s cssInterop to style third-party components, replace it with Uniwind’s withUniwind:
Learn more about
withUniwind in the withUniwind API documentation.Step 12: Handle safe area utilities
If you used Nativewind’sp-safe or m-safe class names, you’ll need to use the useSafeAreaInsets hook from react-native-safe-area-context instead:
Before: Using p-safe
Before: Using p-safe
After: Using useSafeAreaInsets
After: Using useSafeAreaInsets
Step 13: Update animated class names
If you used Nativewind’sanimated class names from Tailwind, you’ll need to use Reanimated’s syntax directly.
Need Help?
Missing Features?
If you’re using Nativewind and notice any missing features in Uniwind, please open an issue on GitHub. We’re happy to add support!
Still having issues with migration? Start a discussion on GitHub and we’ll help you migrate.

