Home > Software engineering >  Material UI Button Returning an error when using creatMuiTheme
Material UI Button Returning an error when using creatMuiTheme

Time:10-21

Why is this returning an error?

const btn = createMuiTheme({Button: {borderRadius: 100%},});
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

CodePudding user response:

You have to change the Button to MuiButton.

Refer this link. https://mui.com/customization/theme-components/#css


const theme = createTheme({
  components: {
    // Name of the component
    MuiButton: {
      styleOverrides: {
        // Name of the slot
        root: {
          // Some CSS
          borderRadius: '100%' 
        },
      },
    },
  },
});

  • Related