This is a starter template for building mobile applications using React Native, Expo, and NativeWind. This setup provides a streamlined development environment for building cross-platform apps with Tailwind CSS styling through NativeWind.
Make sure you have the following installed:
npm install -g expo-cli
git clone https://github.com/MasFana/Nativewind-Starter
cd Nativewind-Starter
Use npm
to install the necessary dependencies:
npm install
Use pnpm
to install the necessary dependencies:
pnpm install
Launch the Expo development server with:
npm start
pnpm start
This will start the Expo development environment, where you can preview the app on an emulator or physical device.
.
├── App.jsx # Main application entry
├── assets/ # Asset files (images, fonts, etc.)
├── components/ # Reusable components
├── screens/ # Screen components for navigation
└── tailwind.config.js # Tailwind CSS configuration for NativeWind
Configure Tailwind CSS in tailwind.config.js
:
// tailwind.config.js
module.exports = {
content: [
"./App.js",
"./screens/**/*.{js,jsx,ts,tsx}",
"./components/**/*.{js,jsx,ts,tsx}"
],
theme: {
extend: {},
},
plugins: [],
}
NativeWind is already configured to support Tailwind classes in your React Native components. Use Tailwind classes as usual in your components.
Optional you can install Tailwind CSS IntelliSense Extension in VSCode
pnpm start
- Start the Expo development serverpnpm build
- Build the app for production