Material UI is the #1 UI for Reactjs and it continues it journey. Can I customize theme in MUI ?

With custom theme object we can create and implement the theme for any component or a group of component using a wrapper component. We require the following

  • createTheme
  • ThemeProvider

CreateTheme

     const theme = createTheme(          {              palette:                  { mode: 'light'}          }      );

We can customize the them using the createtheme function.

ThemeProvider

With the ThemeProvider we can provide theme for the component tree. It take a theme as prop.

 return (          <div>              <ThemeProvider theme={theme} >                  {props.children}              </ThemeProvider>          </div>      )

This free site is ad-supported. Learn more