Skip to content

Commit 1aa1a9d

Browse files
committed
Initial commit from Create Next App
0 parents  commit 1aa1a9d

14 files changed

+936
-0
lines changed

Diff for: .gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

Diff for: README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Next.js + Tailwind CSS Example
2+
3+
This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v3.0)](https://tailwindcss.com/blog/tailwindcss-v3) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs).
4+
5+
## Deploy your own
6+
7+
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-tailwindcss)
8+
9+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss&project-name=with-tailwindcss&repository-name=with-tailwindcss)
10+
11+
## How to use
12+
13+
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
14+
15+
```bash
16+
npx create-next-app --example with-tailwindcss with-tailwindcss-app
17+
```
18+
19+
```bash
20+
yarn create next-app --example with-tailwindcss with-tailwindcss-app
21+
```
22+
23+
```bash
24+
pnpm create next-app --example with-tailwindcss with-tailwindcss-app
25+
```
26+
27+
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).

Diff for: next.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** @type {import('next').NextConfig} */
2+
module.exports = {
3+
reactStrictMode: true,
4+
}

Diff for: package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "next dev",
5+
"build": "next build",
6+
"start": "next start"
7+
},
8+
"dependencies": {
9+
"next": "latest",
10+
"react": "18.1.0",
11+
"react-dom": "18.1.0"
12+
},
13+
"devDependencies": {
14+
"@types/node": "17.0.35",
15+
"@types/react": "18.0.9",
16+
"@types/react-dom": "18.0.5",
17+
"autoprefixer": "^10.4.7",
18+
"postcss": "^8.4.14",
19+
"tailwindcss": "^3.1.2",
20+
"typescript": "4.7.2"
21+
}
22+
}

Diff for: pages/_app.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import '../styles/globals.css'
2+
import type { AppProps } from 'next/app'
3+
4+
function MyApp({ Component, pageProps }: AppProps) {
5+
return <Component {...pageProps} />
6+
}
7+
8+
export default MyApp

Diff for: pages/api/hello.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2+
import type { NextApiRequest, NextApiResponse } from 'next'
3+
4+
type Data = {
5+
name: string
6+
}
7+
8+
export default function handler(
9+
req: NextApiRequest,
10+
res: NextApiResponse<Data>
11+
) {
12+
res.status(200).json({ name: 'John Doe' })
13+
}

Diff for: pages/index.tsx

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import type { NextPage } from 'next'
2+
import Head from 'next/head'
3+
import Image from 'next/image'
4+
5+
const Home: NextPage = () => {
6+
return (
7+
<div className="flex min-h-screen flex-col items-center justify-center py-2">
8+
<Head>
9+
<title>Create Next App</title>
10+
<link rel="icon" href="/favicon.ico" />
11+
</Head>
12+
13+
<main className="flex w-full flex-1 flex-col items-center justify-center px-20 text-center">
14+
<h1 className="text-6xl font-bold">
15+
Welcome to{' '}
16+
<a className="text-blue-600" href="https://nextjs.org">
17+
Next.js!
18+
</a>
19+
</h1>
20+
21+
<p className="mt-3 text-2xl">
22+
Get started by editing{' '}
23+
<code className="rounded-md bg-gray-100 p-3 font-mono text-lg">
24+
pages/index.tsx
25+
</code>
26+
</p>
27+
28+
<div className="mt-6 flex max-w-4xl flex-wrap items-center justify-around sm:w-full">
29+
<a
30+
href="https://nextjs.org/docs"
31+
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
32+
>
33+
<h3 className="text-2xl font-bold">Documentation &rarr;</h3>
34+
<p className="mt-4 text-xl">
35+
Find in-depth information about Next.js features and its API.
36+
</p>
37+
</a>
38+
39+
<a
40+
href="https://nextjs.org/learn"
41+
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
42+
>
43+
<h3 className="text-2xl font-bold">Learn &rarr;</h3>
44+
<p className="mt-4 text-xl">
45+
Learn about Next.js in an interactive course with quizzes!
46+
</p>
47+
</a>
48+
49+
<a
50+
href="https://github.com/vercel/next.js/tree/canary/examples"
51+
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
52+
>
53+
<h3 className="text-2xl font-bold">Examples &rarr;</h3>
54+
<p className="mt-4 text-xl">
55+
Discover and deploy boilerplate example Next.js projects.
56+
</p>
57+
</a>
58+
59+
<a
60+
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
61+
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
62+
>
63+
<h3 className="text-2xl font-bold">Deploy &rarr;</h3>
64+
<p className="mt-4 text-xl">
65+
Instantly deploy your Next.js site to a public URL with Vercel.
66+
</p>
67+
</a>
68+
</div>
69+
</main>
70+
71+
<footer className="flex h-24 w-full items-center justify-center border-t">
72+
<a
73+
className="flex items-center justify-center gap-2"
74+
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
75+
target="_blank"
76+
rel="noopener noreferrer"
77+
>
78+
Powered by{' '}
79+
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
80+
</a>
81+
</footer>
82+
</div>
83+
)
84+
}
85+
86+
export default Home

Diff for: postcss.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

Diff for: public/favicon.ico

14.7 KB
Binary file not shown.

Diff for: public/vercel.svg

+4
Loading

Diff for: styles/globals.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

Diff for: tailwind.config.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: [
4+
'./pages/**/*.{js,ts,jsx,tsx}',
5+
'./components/**/*.{js,ts,jsx,tsx}',
6+
],
7+
theme: {
8+
extend: {},
9+
},
10+
plugins: [],
11+
}

Diff for: tsconfig.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": true,
8+
"forceConsistentCasingInFileNames": true,
9+
"noEmit": true,
10+
"esModuleInterop": true,
11+
"module": "esnext",
12+
"moduleResolution": "node",
13+
"resolveJsonModule": true,
14+
"isolatedModules": true,
15+
"jsx": "preserve",
16+
"incremental": true
17+
},
18+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
19+
"exclude": ["node_modules"]
20+
}

0 commit comments

Comments
 (0)