Using tailwind with react

Should I use Next.js if I want to style React app with Tailwind ?

Hi, welcome to the forum.

To answer the question, nope you don’t need next js for a css library, use Next.js if you want to have a node server serving the pages. If you want to develop a client side application with tailwind you certainly don’t need next.js.

Depends on your needs.

I think this is the tutorial you are looking for Install Tailwind CSS with Create React App - Tailwind CSS

This should explain in more detail Comparing Create React App vs. Next.js performance differences - LogRocket Blog

The warning in the first link that confused me. So to use tailwind it’s better to use Vite, am I right?

If you know you need custom configuration then yes. That’s what that warning is about.

Most of this development thing is to research the tools you need based on what you need to achieve.

A good rule to follow is not to chase things you don’t need.

If you just need tailwind and react use the link above if you know you need custom configuration then Install Tailwind CSS with Vite - Tailwind CSS .

If you need a node server and routing and SSR go with next.js.

The question is “what do you need?”.

Also ask yourself often “why”.

For example if you ask yourself “why do I need custom configuration?” If you don’t have a good answer is likely that you don’t need it.

This “why” applies to pretty much every decision you take when it comes to choosing tools or a particular architecture.

This is the way I do. Hope it helps.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.