0

Why is this returning an error?

const btn = createMuiTheme({Button: {borderRadius: 100%},});

1 Answer 1

1

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%' 
        },
      },
    },
  },
});

Sign up to request clarification or add additional context in comments.

8 Comments

what does name of the slot mean?
Basically CSS property which you want to change. For the case of button visit this. mui.com/api/button/#css
For all other modification you'll be able to check the API page of each component. That should guide you.
gotcha, so i copied and pasted exactly what you put, but it didn't change anything.
Are you trying to change this for a single button or for entire platform? If you're making this change it will affect the entire platform.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.