0

我知道我可以自定义标准 MUI 组件,例如 Button,但我可以创建自己的 MyCustomButton,它具有'muiName' = 'MyCustomButton'并且可以通过主题配置进行自定义:

createTheme({
  components: { 
    MyCustomButton: {
      styleOverrides: { 
        root: {...}, 
        MyCustomButtonSubComponent: {...}
      }
    }
  }
})

谢谢您的回答!

4

1 回答 1

0

你有几个选择。假设您想创建一个具有 MUI 按钮行为的完全自定义按钮。

您可以使用ButtonUnstyleduseButton钩子。

https://mui.com/components/buttons/#unstyled

于 2021-11-10T09:35:45.267 回答