Installation

How to install dependencies and structure your React Native app.

Automatic setup

Run init with --yes to install dependencies and write Metro, Babel, Tailwind, and theme files.

npx ghost-ui-native init --yes

Manual checklist

  1. Install NativeWind, Tailwind 3.4, and peer dependencies.
  2. Add global.css and tailwind.config.js.
  3. Configure Metro with withNativeWind and Babel with nativewind/babel.
  4. Import ./global.css once at the app entry.
  5. Wrap with SafeAreaProvider and GhostUIProvider.
  6. Restart Metro with --reset-cache.

App entry

App.tsx
import './global.css';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { GhostUIProvider } from '@/components/ghost-ui-provider';

export default function App() {
  return (
    <SafeAreaProvider>
      <GhostUIProvider defaultTheme="system">
        <YourApp />
      </GhostUIProvider>
    </SafeAreaProvider>
  );
}

Add components

npx ghost-ui-native add button card input
Add all
npx ghost-ui-native add --all --yes

Verify setup

npx ghost-ui-native doctor