- Published on
Next.js App Setup
- Authors
- Name
- Shelton Ma
1. create next app
npx create-next-app@latest app_name
cd app_name
2. setup shadcn
Init shadcn:
npx shadcn@latest init
Generate new files
- tailwind.config.ts
- src/app/globals.css
- src/lib/utils.ts
- components.json
To ensure that all your components correctly apply Tailwind CSS, you need to include the paths to your components, pages, and any other relevant files in the tailwind.config.js file
Fix eslint error: A
require()
style import is forbidden// tailwind.config.ts import tailwindcssAnimate from "tailwindcss-animate"; plugins: [tailwindcssAnimate],
Add shadcn ui componments. run
npx shadcn@latest add button
, will create the Button component atsrc/components/ui/button.tsx
.If you use VS Code, please make sure to install the plugin:
Tailwind CSS IntelliSense
, VS Marketplace Link