Skip to content

Commit 942d8c3

Browse files
committed
Initial commit from Create Next App
0 parents  commit 942d8c3

16 files changed

+1072
-0
lines changed

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel
35+
36+
# typescript
37+
*.tsbuildinfo

README.md

Lines changed: 27 additions & 0 deletions
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+
## Preview
6+
7+
Preview the example live on [StackBlitz](http://stackblitz.com/):
8+
9+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-tailwindcss)
10+
11+
## Deploy your own
12+
13+
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
14+
15+
[![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)
16+
17+
## How to use
18+
19+
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
20+
21+
```bash
22+
npx create-next-app --example with-tailwindcss with-tailwindcss-app
23+
# or
24+
yarn 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)).

next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

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

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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": "^17.0.2",
11+
"react-dom": "^17.0.2"
12+
},
13+
"devDependencies": {
14+
"@types/node": "17.0.4",
15+
"@types/react": "17.0.38",
16+
"autoprefixer": "^10.4.0",
17+
"postcss": "^8.4.5",
18+
"prettier": "^2.5.1",
19+
"prettier-plugin-tailwindcss": "^0.1.1",
20+
"tailwindcss": "^3.0.7",
21+
"typescript": "4.5.4"
22+
}
23+
}

pages/_app.tsx

Lines changed: 8 additions & 0 deletions
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

pages/api/hello.ts

Lines changed: 13 additions & 0 deletions
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+
}

pages/index.tsx

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

postcss.config.js

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

prettier.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'always',
3+
singleQuote: true,
4+
tabWidth: 2,
5+
semi: false,
6+
tailwindConfig: './tailwind.config.js',
7+
}

public/favicon.ico

14.7 KB
Binary file not shown.

public/vercel.svg

Lines changed: 4 additions & 0 deletions
Loading

styles/globals.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

tailwind.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
content: [
3+
'./pages/**/*.{js,ts,jsx,tsx}',
4+
'./components/**/*.{js,ts,jsx,tsx}',
5+
],
6+
theme: {
7+
extend: {},
8+
},
9+
plugins: [],
10+
}

tsconfig.json

Lines changed: 20 additions & 0 deletions
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)