mirror of
https://github.com/zhigang1992/examples.git
synced 2026-01-12 22:47:03 +08:00
Merge pull request #165 from FarazPatankar/master
add with-tailwind example
This commit is contained in:
15
with-tailwind/App.js
Normal file
15
with-tailwind/App.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { SafeAreaView, Text, View } from 'react-native';
|
||||
import tailwind from 'tailwind-rn';
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<SafeAreaView style={tailwind('flex-1 items-center justify-center')}>
|
||||
<View style={tailwind('bg-blue-500 px-5 py-3 rounded-full')}>
|
||||
<Text style={tailwind('text-white font-semibold text-lg')}>
|
||||
Hello Tailwind 👋
|
||||
</Text>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
21
with-tailwind/README.md
Normal file
21
with-tailwind/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Tailwind CSS example
|
||||
|
||||
<p>
|
||||
<!-- iOS -->
|
||||
<img alt="Supports Expo iOS" longdesc="Supports Expo iOS" src="https://img.shields.io/badge/iOS-4630EB.svg?style=flat-square&logo=APPLE&labelColor=999999&logoColor=fff" />
|
||||
<!-- Android -->
|
||||
<img alt="Supports Expo Android" longdesc="Supports Expo Android" src="https://img.shields.io/badge/Android-4630EB.svg?style=flat-square&logo=ANDROID&labelColor=A4C639&logoColor=fff" />
|
||||
<!-- Web -->
|
||||
<img alt="Supports Expo Web" longdesc="Supports Expo Web" src="https://img.shields.io/badge/web-4630EB.svg?style=flat-square&logo=GOOGLE-CHROME&labelColor=4285F4&logoColor=fff" />
|
||||
</p>
|
||||
|
||||
## 🚀 How to use
|
||||
|
||||
- Install with `yarn` or `npm install`.
|
||||
- Run `expo start` to try it out.
|
||||
|
||||
## 📝 Notes
|
||||
|
||||
- This example using the [`tailwind-rn`](https://github.com/vadimdemedes/tailwind-rn) library to allow you to use [Tailwind CSS](https://tailwindcss.com/) in React Native.
|
||||
- You can even customize it to use your own styles or colors. Read more about that [here](https://github.com/vadimdemedes/tailwind-rn#customization).
|
||||
- [Tailwind CSS Documentation](https://tailwindcss.com/docs/utility-first).
|
||||
13
with-tailwind/package.json
Normal file
13
with-tailwind/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"expo": "~37.0.3",
|
||||
"react": "~16.9.0",
|
||||
"react-dom": "~16.9.0",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
|
||||
"react-native-web": "~0.11.7",
|
||||
"tailwind-rn": "^1.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.6"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user