Getting Started

Metro Configuration

Configure the Nitrowind Metro plugin and understand its options.

Metro Configuration

withNitrowindMetroConfig wraps Metro with the Tailwind build pipeline and the nitrocss transformer.

metro.config.js
const { getDefaultConfig } = require('@react-native/metro-config');
const { withNitrowindMetroConfig } = require('@nitrofoundation/nitrowind/metro');

module.exports = withNitrowindMetroConfig(getDefaultConfig(__dirname), {
  input: './global.css',
  content: ['./App.{js,jsx,ts,tsx}', './src/**/*.{js,jsx,ts,tsx}'],
  rem: 16,
});

Options

OptionDefaultDescription
inputRequiredPath to the entry CSS file.
contentApp, app, src, and components globsFiles scanned for className candidates.
rem16Root rem size used when CSS lengths become React Native numbers.
cwdprocess.cwd()Project root for resolving paths.
rewriteReactNativeImportstrueRewrites host component imports to className-aware wrappers.

What the plugin appends

Nitrowind appends generated Tailwind v4 CSS before compilation:

  • Platform variants such as ios: and android:.
  • Safe-area utilities such as pt-safe and h-screen-safe.
  • Reanimated and CSS animation utilities such as entering-fade-in and animate-wiggle.

The compiled CSS is flattened and converted into a compact artifact that the runtime and native engine can resolve.

On this page