javascript – React JS, MUI different kinds of styling
Check out this response to a similar question to get up to speed on all of the different styling and theming options in Material UI v5:
1. At the individual component level
- for one-off customizations of components that won’t be reused, use the
sxprop
2. At the reusable component level
3. At the theme level
4. At the baseline / global level
- if you need to apply style overrides above and beyond the theme level (such as a CSS reset for baseline style preferences), you can use the
<GlobalStyles />component
I hope this helps! As you’ll see from the use cases described, there really is no “preferred” way to customize—the library provides several options that are each ideal for different situations, and you’ll probably discover that you need to use some combination of them all as you’re building your UI.
Read more here: Source link
