hankhng / nextjs13-demo

Demo of NextJs 13 with all the new features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Next.js + Tailwind CSS Example

This example shows how to use Tailwind CSS (v3.2) with Next.js. It follows the steps outlined in the official Tailwind docs.

Deploy your own

Deploy the example using Vercel or preview live with StackBlitz

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example with-tailwindcss with-tailwindcss-app
yarn create next-app --example with-tailwindcss with-tailwindcss-app
pnpm create next-app --example with-tailwindcss with-tailwindcss-app

Deploy it to the cloud with Vercel (Documentation).

Notes:

  • When you npm run dev, the files will always be SSR
  • The only way to test static generation is to npm run build && npm run start to see the effect of statically generated site
  • Main reason to use client component is to allow user interactivity / stateful-ness / anything done on the browser / requires element to be binded to
  • Source: https://beta.nextjs.org/docs/rendering/fundamentals

// http://localhost:3000/search/Javascript // "search" is the segment of the url // "Javascript" is the leaf node of the url

https://beta.nextjs.org/docs/routing/defining-routes#route-groups

  • To organise routes without affecting the URL, create a group to keep related routes together. The folders in parenthesis will be omitted from the URL (e.g. (marketing) or (shop)).

About

Demo of NextJs 13 with all the new features


Languages

Language:TypeScript 94.4%Language:JavaScript 4.9%Language:CSS 0.6%