Blog image

HHH

Saleh Ahmed

Saleh Ahmed


React Native + NativeWind Template

A minimal but robust template for React Native projects using NativeWind (TailwindCSS), Expo Router, and TypeScript with built-in dark/light theme support.

šŸš€ Quick Start

    git clone https://github.com/SalehAhmed10/Expo-ReactNative-NativeWind-Tailwind-Template.git
    cd Expo-ReactNative-NativeWind-Tailwind-Template
    npm install
    npx expo start

šŸ“¦ What's Included

  • āš”ļø Expo Router for navigation
  • šŸŽØ NativeWind (TailwindCSS) for styling
  • šŸŒ“ Dark/Light theme with system sync
  • šŸ“± Responsive design ready
  • šŸ” TypeScript for type safety

šŸŽØ Theme System

The template includes a complete theme system with:

  • System theme detection
  • Manual theme toggle
  • HSL color system with opacity support
  • Consistent styling across light/dark modes

āš ļø Known Issues & Fixes

1. NativeWind Babel Error

Fix: Use NativeWind version 2.0.11

json { "dependencies": { "nativewind": "^2.0.11" } }

šŸ“ Project Structure

ā”œā”€ā”€ app/ ā”‚ ā”œā”€ā”€ layout.tsx # Root layout with theme provider ā”‚ ā”œā”€ā”€ index.tsx # Home screen ā”‚ ā””ā”€ā”€ +not-found.tsx # 404 page ā”œā”€ā”€ components/ ā”‚ ā””ā”€ā”€ ThemeToggle.tsx # Theme toggle component ā”œā”€ā”€ context/ ā”‚ ā””ā”€ā”€ ThemeProvider.tsx # Theme management ā”œā”€ā”€ babel.config.js ā”œā”€ā”€ tailwind.config.js # Theme configuration ā””ā”€ā”€ tsconfig.json

šŸ›  Configuration Files

tailwind.config.js

Contains theme colors and configuration. Modify this file to customize your color scheme.

babel.config.js

Includes necessary configuration for NativeWind.

šŸ“± Supported Platforms

  • iOS
  • Android
  • Web (with appropriate configuration)

šŸ“„ License

MIT

šŸ¤ Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

No links added