Home > Enterprise >  What is the best way to override CSS in MUI without using MUI themes?
What is the best way to override CSS in MUI without using MUI themes?

Time:11-22

I am using Material UI in my project. I want to know the best way to override the CSS in react components without using MUI theme.

CodePudding user response:

You can simply give your own class name to the MUI component and apply your own style.

However, sometimes you will need to use MUI original class names in order to override inner properties that you can't access by yourself but as long you have your own parent class (in order to not override other MUI components with same inner class names) it should work just fine.

CodePudding user response:

You have many ways to customize Material UI components:

  1. One-off customization
  2. Reusable component
  3. Global theme overrides
  4. Global CSS override

All of these methods are explained in detail in Mui Documentation > Customization

  • Related