create-next-app and selected Tailwind CSS (the default), Tailwind CSS 4 is already installed and configured. You can verify this and move on to Add Utilities.
Tailwind CSS v4 ships with Next.js by default as of Next.js 15+. The configuration is now CSS-first — there is no
tailwind.config.ts file unless you create one.Verify your setup
Check thatapp/globals.css contains the Tailwind import:
app/globals.css
Tailwind CSS 4 (manual setup)
If you are adding Tailwind CSS 4 to an existing project that was not created withcreate-next-app, follow these steps.
1
Install packages
2
Configure PostCSS
Create a
postcss.config.mjs file at your project root.postcss.config.mjs
3
Add the Tailwind import
Add the import to your main CSS file.
app/globals.css
4
Start the dev server
Tailwind CSS 3 (legacy)
If you are using Tailwind CSS v3 in an existing project and cannot upgrade yet, follow these steps.1
Install packages
2
Configure content paths
Update
tailwind.config.ts to include all files that use Tailwind classes.tailwind.config.ts
3
Add Tailwind directives
app/globals.css
Key differences between v3 and v4
Dark mode CSS variables
RareUI components use CSS variables for dark mode. Add these to yourglobals.css to support both light and dark themes:
app/globals.css
Next steps
- Add utilities — install animation dependencies and the
cn()helper - CLI — add components with a single command