npx skills add ...
npx skills add expo/skills --skill expo-tailwind-setup
Framework (OSS). Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling
npx skills add expo/skills --skill expo-tailwind-setup
This guide covers setting up Tailwind CSS v4 in Expo using react-native-css and NativeWind v5 for universal styling across iOS, Android, and Web.
This setup uses:
Add resolutions for lightningcss compatibility:
Create or update metro.config.js:
Create postcss.config.mjs:
Create src/global.css:
With Tailwind v4 and NativeWind v5, you do NOT need a babel.config.js for Tailwind. Remove any NativeWind babel presets if present:
Since react-native-css requires explicit CSS element wrapping, create reusable components:
src/tw/index.tsx)src/tw/image.tsx)src/tw/animated.tsx)Import CSS-wrapped components from your tw directory:
Add custom theme variables in your global.css using @theme:
Use platform media queries for platform-specific styling:
Create a CSS file for Apple semantic colors:
Then use in components:
Use the useCSSVariable hook:
@tailwindcss/postcss instead of tailwindcss@import "tailwindcss/..." instead of @tailwind directives@theme in CSS instead of tailwind.config.jsuseCssElement for className supportwithNativewind with different options (inlineVariables: false)useCssElementwithNativewind appliedplatformColor() in @media ios blockslight-dark() for web/AndroidAdd className to component props:
If you encounter errors, misleading or outdated information in this skill, report it so Expo can improve:
Only submit when you have something specific and actionable to report. Include as much relevant context as possible. If an AI agent repeatedly failed or the user had to take over an Expo task, load the expo-skill-feedback skill and follow its eval-candidate flow instead of reusing the command above.