This project is a customized Expo React Native app, based on the default Expo template with expo-router (file-based routing and tabs) and preconfigured with NativeWind + TailwindCSS for utility-first styling.
It can be used as a starter template for new React Native projects that need:
- Expo Router (file-based routing with layouts, nested routes, and tabs)
- NativeWind (TailwindCSS for React Native styling)
- Metro bundler configured to work with Tailwind
- TypeScript setup out of the box
- Dark mode support (via Expo useColorScheme)
- React Native + Expo -- managed workflow
- expo-router -- file-based navigation
- app/_layout.tsx --> root layout
- app/(tabs)/_layout.tsx --> tab navigation
- NativeWind (TailwindCSS) -- preconfigured for styling
- global.css included and imported in root layout
- tailwind.config.js with NativeWind preset
- babel.config.js + metro.config.js updated
- TypeScript support with typed routes
- Dark/light theme support
- Node.js 18 or 20 (LTS recommended)
- Expo CLI (npx expo)
- Expo Go app installed on a physical device
Clone this repo and install dependencies (if you are not using the GitHub template flow yet):
git clone https://github.com/johnmchale/expo-nativewind-template
cd expo-nativewind-template
npm installStart the Expo development server:
npx expo start -cScan the QR code with the Expo Go app (iOS or Android) to preview the app.
- The default template tabs are set up in app/(tabs)/, but the example index.tsx has been replaced with a NativeWind test screen. The tab bar may not be visible until you restore the default content.
- To restore the default tabs screen, replace the content of app/(tabs)/index.tsx with your preferred layout or the original example.
- app/_layout.tsx --> root layout, imports global.css
- app/(tabs)/_layout.tsx --> bottom tab navigator
- global.css --> Tailwind entry point
- tailwind.config.js --> Tailwind + NativeWind config
- babel.config.js --> includes NativeWind preset
- metro.config.js --> wires Tailwind into Metro bundler
- nativewind-env.d.ts --> TypeScript types for NativeWind
import { View, Text } from "react-native";
export default function HomeScreen() {
return (
<View className="flex-1 items-center justify-center bg-white dark:bg-black">
<Text className="text-2xl font-bold text-blue-500">
Hello from NativeWind!
</Text>
<Text className="mt-4 text-lg text-gray-600 dark:text-gray-300">
Tailwind styles are working
</Text>
</View>
);
}This repository can be used as a GitHub template. To create your own project based on this template, follow these steps.
- Go to your repository on GitHub.
- Click Settings.
- Scroll to the Template repository section.
- Check "Template repository".
Once marked as a template, others will see the "Use this template" button at the top of the repo.
- On GitHub, click the green "Use this template" button at the top of this repo.
- Choose a repository name (for example, myfinanceapp) and create it under your account.
git clone https://github.com/<your-username>/myfinanceapp.git
cd myfinanceappUpdate only these fields:
{
"expo": {
"name": "myfinanceapp",
"slug": "myfinanceapp",
"scheme": "myfinanceapp"
}
}- name --> Human-readable app name (shown under the icon in Expo Go)
- slug --> Short identifier used by Expo internally
- scheme --> Deep link scheme (for example, myfinanceapp://)
Change the project name:
{
"name": "myfinanceapp"
}{
"expo": {
"ios": { "bundleIdentifier": "com.mycompany.myfinanceapp" },
"android": { "package": "com.mycompany.myfinanceapp" }
}
}rm -rf node_modules
npm install
npx expo start -cYour project has now been created from the template and configured under the new name.
This is an Expo project created with create-expo-app.
-
Install dependencies
npm install
-
Start the app
npx expo start
In the output, you will find options to open the app in a
- development build
- Android emulator
- iOS simulator
- Expo Go, a limited sandbox for trying out app development with Expo
When you are ready, run:
npm run reset-projectThis command will move the starter code to the app-example directory and create a blank app directory where you can start developing.
- Expo documentation: https://docs.expo.dev
- Learn Expo tutorial: https://docs.expo.dev/tutorial/introduction
- Expo on GitHub: https://github.com/expo/expo
- Discord community: https://chat.expo.dev