Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Tailwind CSS and Material UI (MUI) in the same Next.js project?

If I used both of them, could I run into conflicts? Is this a good approach to use?

like image 278
axel94 Avatar asked Sep 13 '25 01:09

axel94


2 Answers

It is possible and the MUI team has resolved it.

From the documentation:

If you are used to Tailwind CSS and want to use it together with the MUI components, you can start by cloning the Tailwind CSS example project. If you use a different framework or already have set up your project.

It is necessary to Remove Tailwind's base directive in favor of the CssBaseline component provided by @mui/material and fix the CSS injection order.

like image 189
LuisSolis Avatar answered Sep 14 '25 15:09

LuisSolis


Yes you can run both ui framework. But it is not a good approach. Every ui framework has the complete solution for designing ui part. Like in tailwind css you can have the JIT compiler for compilation your custom css. Or the other hand MUI has also.

I think you can go through just only on ui framework. I have suggestion for ui. For your next js project you can use- Tailwind Css Theme-ui

Thank you.

like image 26
Siam Ahnaf Avatar answered Sep 14 '25 13:09

Siam Ahnaf