styling-nativewind-v4-expo
About styling-nativewind-v4-expo
A skill for configuring and debugging NativeWind v4 in Expo apps. It emphasizes checking the existing project setup, preserving unrelated configuration, and validating native and web rendering against the installed stack.
Key features
- 01Inspect Expo and project configuration
- 02Set up NativeWind v4 with Tailwind v3
- 03Diagnose CSS, Metro, and Babel issues
- 04Build typed components and variant maps
- 05Check accessibility and rendering
Use cases
- 01Add NativeWind v4 to an existing Expo app
- 02Troubleshoot missing or ineffective utility styles
- 03Integrate third-party components with CSS interop
- 04Validate styling across native and web targets
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ tristanmanchester/ agent-skills --skill styling-nativewind-v4-expoAfter installing, type/styling-nativewind-v4-expoin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/expo-setup.mdpatterns.mdtheming-dark-mode.mdthird-party-components.mdtroubleshooting.mdDetails
From the project READMENativeWind v4 in Expo
This is deliberately a v4 skill. On the review date, the official site labels v5 a prerelease; v5/Tailwind v4 configuration is a separate stack, not a drop-in refresh of these files. Inspect the lockfile before editing and keep this skill's dependency majors explicit.
Establish the configuration
Read package.json and the lockfile, the actual app entry, Expo config, Babel config, Metro config, Tailwind config, and the CSS entry. Identify Expo Router versus a classic entry and account for src/app, monorepos, or a custom project root.
Use references/expo-setup.md for the coordinated v4 setup. The invariant is:
nativewind@^4withtailwindcss@^3.4.17; native peers resolved through the app's Expo SDK.nativewind/presetand content globs covering every source of complete utility strings.- One CSS entry using the Tailwind v3 directives, connected to both Metro's
withNativeWindinput and the real application entry. nativewind/babelin Babel presets, withjsxImportSource: "nativewind"onbabel-preset-expo.nativewind-env.d.tsreferencingnativewind/types, without shadowing the package/module name.
Preserve unrelated Metro wrappers, Babel plugins, config plugins, and project module format. Do not replace a working app's configuration wholesale or install a second incompatible Reanimated/Worklets stack.
Debug in a useful order
- Verify resolved dependency majors and the first actual error; a cache reset does not repair a Tailwind v4/v3 mismatch.
- Compile the CSS entry with the project's installed Tailwind v3 CLI. Check content globs, static class strings, and the NativeWind preset.
- Verify the CSS file, Metro input, and application import refer to the same file. Calculate paths from their real locations, including
src/app/_layout.tsx. - Merge the required Babel/Metro integration, then restart Metro with
npx expo start --clear. - Test an obvious layout/text/colour change on each target platform, then the failing component. A successful web render alone does not prove native interop.
Use references/troubleshooting.md for further diagnosis. Resolve bundled reference paths from this skill's directory, not the app's directory.
Build components
Use literal variant maps rather than dynamically constructing class names the scanner cannot see. references/patterns.md covers typed components, explicit override semantics, and accessible Pressable content. Concatenating class strings does not guarantee that the last conflicting utility wins.
Use references/third-party-components.md only when a component needs remapProps or cssInterop; configure interop once, not during every render. Use references/theming-dark-mode.md for the v4 colour-scheme and CSS-variable APIs.
Inspect the existing safe-area provider before adding another. Expo Router normally supplies the root integration; separate native roots or modal boundaries may need their own provider. Verify actual insets, nested navigation, and rotation rather than treating provider count as a universal rule.
Verify and report
Run the project's typecheck and Expo dependency checks, compile/bundle its actual targets, and inspect native/web rendering where those environments are available. Check dark mode, disabled/pressed states, font scaling, safe areas, and third-party components affected by the change. Report the resolved dependency versions, files changed, and platforms actually tested; static configuration inspection is not a device test.
Sources
Reviewed 2026-09-13 against NativeWind installation and custom components. For optional conflict merging, tailwind-merge explicitly directs Tailwind v3 users to its v2.6.0 line.