nextjs-nativewind 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/app/_layout.jsx +18 -0
- package/app/index.jsx +21 -0
- package/app/profile/index.jsx +26 -0
- package/app.json +34 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/msh.png +0 -0
- package/assets/splash-icon.png +0 -0
- package/babel.config.js +9 -0
- package/components/navBar.jsx +48 -0
- package/global.css +3 -0
- package/metro.config.js +6 -0
- package/package.json +48 -0
- package/tailwind.config.js +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mawuko Senyo Hayibor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# nextjs-nativewind
|
|
2
|
+
|
|
3
|
+
A **medium-weight Expo template** preconfigured with:
|
|
4
|
+
|
|
5
|
+
- [Expo Router](https://expo.github.io/router) for file-based navigation
|
|
6
|
+
- [NativeWind](https://www.nativewind.dev/) (Tailwind CSS for React Native)
|
|
7
|
+
- [Expo Vector Icons](https://docs.expo.dev/guides/icons/) for icons
|
|
8
|
+
- [React Native Reanimated](https://docs.expo.dev/versions/latest/sdk/reanimated/) for animations
|
|
9
|
+
- A few other common Expo dependencies like `expo-constants`, `expo-linking`, `expo-status-bar`
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🚀 Getting Started
|
|
14
|
+
|
|
15
|
+
Create a new Expo app using this template:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx create-expo-app my-app --template nextjs-nativewind
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
package/app/_layout.jsx
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "../global.css";
|
|
2
|
+
import { Slot } from "expo-router";
|
|
3
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
4
|
+
import NavBar from "../components/navBar";
|
|
5
|
+
const RootLayout = () => {
|
|
6
|
+
return (
|
|
7
|
+
<View>
|
|
8
|
+
<View className="flex-1">
|
|
9
|
+
<Slot />
|
|
10
|
+
<NavBar />
|
|
11
|
+
</View>
|
|
12
|
+
</View>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default RootLayout;
|
|
17
|
+
|
|
18
|
+
const styles = StyleSheet.create({});
|
package/app/index.jsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Dimensions, StyleSheet, Text, View } from "react-native";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const { width, height } = Dimensions.get("screen");
|
|
5
|
+
|
|
6
|
+
const Home = () => {
|
|
7
|
+
return (
|
|
8
|
+
<View
|
|
9
|
+
className="justify-center items-center"
|
|
10
|
+
style={{ width: width, height: height }}
|
|
11
|
+
>
|
|
12
|
+
<View>
|
|
13
|
+
<Text className="text-gray-500">Welcome to the Home Page!</Text>
|
|
14
|
+
</View>
|
|
15
|
+
</View>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default Home;
|
|
20
|
+
|
|
21
|
+
const styles = StyleSheet.create({});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useLocalSearchParams } from "expo-router";
|
|
2
|
+
import { Dimensions, StyleSheet, Text, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
const { width, height } = Dimensions.get("screen");
|
|
5
|
+
const Profile = () => {
|
|
6
|
+
const { params } = useLocalSearchParams();
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<View
|
|
10
|
+
className="justify-center items-center p-4 gap-4"
|
|
11
|
+
style={{ width: width, height: height }}
|
|
12
|
+
>
|
|
13
|
+
<Text className="text-gray-500">
|
|
14
|
+
Welcome to the Profile Page. This page is to show that the flie-based
|
|
15
|
+
routing works🥳🥳🥳
|
|
16
|
+
</Text>
|
|
17
|
+
<Text className="text-gray-500">
|
|
18
|
+
<Text className="font-bold">Passed Params:</Text> {params}
|
|
19
|
+
</Text>
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default Profile;
|
|
25
|
+
|
|
26
|
+
const styles = StyleSheet.create({});
|
package/app.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"expo": {
|
|
3
|
+
"scheme": "{{{ projectName }}}",
|
|
4
|
+
"name": "{{{ projectName }}}",
|
|
5
|
+
"slug": "{{{ projectName }}}",
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"orientation": "portrait",
|
|
8
|
+
"icon": "./assets/msh.png",
|
|
9
|
+
"userInterfaceStyle": "light",
|
|
10
|
+
"newArchEnabled": true,
|
|
11
|
+
"splash": {
|
|
12
|
+
"image": "./assets/msh.png",
|
|
13
|
+
"resizeMode": "contain",
|
|
14
|
+
"backgroundColor": "#ffffff"
|
|
15
|
+
},
|
|
16
|
+
"ios": {
|
|
17
|
+
"supportsTablet": true
|
|
18
|
+
},
|
|
19
|
+
"android": {
|
|
20
|
+
"adaptiveIcon": {
|
|
21
|
+
"foregroundImage": "./assets/adaptive-icon.png",
|
|
22
|
+
"backgroundColor": "#ffffff"
|
|
23
|
+
},
|
|
24
|
+
"edgeToEdgeEnabled": true
|
|
25
|
+
},
|
|
26
|
+
"web": {
|
|
27
|
+
"bundler": "metro",
|
|
28
|
+
"favicon": "./assets/favicon.png"
|
|
29
|
+
},
|
|
30
|
+
"plugins": [
|
|
31
|
+
"expo-router"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
Binary file
|
|
Binary file
|
package/assets/icon.png
ADDED
|
Binary file
|
package/assets/msh.png
ADDED
|
Binary file
|
|
Binary file
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { View, Text, TouchableOpacity, Dimensions } from "react-native";
|
|
2
|
+
import AntDesign from "@expo/vector-icons/AntDesign";
|
|
3
|
+
import { usePathname, useRouter } from "expo-router";
|
|
4
|
+
const { width, height } = Dimensions.get("screen");
|
|
5
|
+
const NavBar = () => {
|
|
6
|
+
const pathname = usePathname();
|
|
7
|
+
const router=useRouter()
|
|
8
|
+
|
|
9
|
+
const params="This is just to show how to pass parameters: Hello World" //Example parameter to be passed
|
|
10
|
+
|
|
11
|
+
// handling onPress Routing
|
|
12
|
+
const handlePress=(path)=>{
|
|
13
|
+
router.push({pathname:path,params:{params:params}})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// Naming the pathnames
|
|
18
|
+
const homePathname = "/";
|
|
19
|
+
const profilePathname = "/profile";
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<View className="items-center">
|
|
23
|
+
<View
|
|
24
|
+
className="absolute bottom-16 flex-row justify-around items-center text-[#ccc9c9] bg-gray-700 border border-white p-4 rounded-full gap-4 shadow-2xl"
|
|
25
|
+
style={{ maxWidth: width, minWidth: width * 0.4 }}
|
|
26
|
+
>
|
|
27
|
+
<View>
|
|
28
|
+
<TouchableOpacity onPress={()=>handlePress("/")} className="justify-center items-center gap-1">
|
|
29
|
+
<AntDesign
|
|
30
|
+
name="home"
|
|
31
|
+
size={20}
|
|
32
|
+
color={pathname === homePathname ? "white":"#ccc9c9" }
|
|
33
|
+
/>
|
|
34
|
+
<Text className={`${pathname===homePathname?"text-white":"text-[#ccc9c9]"} text-xs`}> Home</Text>
|
|
35
|
+
</TouchableOpacity>
|
|
36
|
+
</View>
|
|
37
|
+
<View>
|
|
38
|
+
<TouchableOpacity onPress={()=>handlePress("/profile")} className="justify-center items-center gap-1">
|
|
39
|
+
<AntDesign name="user" size={20} color={pathname === profilePathname ?"white": "#ccc9c9" } />
|
|
40
|
+
<Text className={`${pathname===profilePathname?"text-[#ccc9c9]":"text-white"} text-xs`}> Profile</Text>
|
|
41
|
+
</TouchableOpacity>
|
|
42
|
+
</View>
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default NavBar;
|
package/global.css
ADDED
package/metro.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nextjs-nativewind",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Expo template with Expo Router (Next.js-style routing) and NativeWind preconfigured.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"expo",
|
|
7
|
+
"template",
|
|
8
|
+
"nativewind",
|
|
9
|
+
"nextjs",
|
|
10
|
+
"javascript"
|
|
11
|
+
],
|
|
12
|
+
"main": "expo-router/entry",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"start": "expo start",
|
|
15
|
+
"android": "expo start --android",
|
|
16
|
+
"ios": "expo start --ios",
|
|
17
|
+
"web": "expo start --web"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@expo/vector-icons": "^15.0.0",
|
|
21
|
+
"expo": "~53.0.20",
|
|
22
|
+
"expo-constants": "~17.1.7",
|
|
23
|
+
"expo-linking": "~7.1.7",
|
|
24
|
+
"expo-router": "~5.1.4",
|
|
25
|
+
"expo-status-bar": "~2.2.3",
|
|
26
|
+
"nativewind": "^4.1.23",
|
|
27
|
+
"prettier-plugin-tailwindcss": "^0.5.14",
|
|
28
|
+
"react": "18.2.0",
|
|
29
|
+
"react-native": "0.79.5",
|
|
30
|
+
"react-native-reanimated": "~3.17.4",
|
|
31
|
+
"react-native-safe-area-context": "^5.4.0",
|
|
32
|
+
"react-native-screens": "~4.11.1",
|
|
33
|
+
"tailwindcss": "^3.4.17"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@babel/core": "^7.20.0"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/Harry-Daniel/nextjs-nativewind.git"
|
|
42
|
+
},
|
|
43
|
+
"author": {
|
|
44
|
+
"name": "Mawuko Senyo Hayibor",
|
|
45
|
+
"email": "hayiborkomla@gmail.com",
|
|
46
|
+
"url": "https://github.com/Harry-Daniel"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
// NOTE: Update this to include the paths to all files that contain Nativewind classes.
|
|
4
|
+
content: ["./app/**/*.{js,jsx,ts,tsx}", "./components/**/*.{js,jsx,ts,tsx}"],
|
|
5
|
+
presets: [require("nativewind/preset")],
|
|
6
|
+
theme: {
|
|
7
|
+
extend: {},
|
|
8
|
+
},
|
|
9
|
+
plugins: [],
|
|
10
|
+
}
|