Is it possible to change the icon of the checkbox from the theme in Material UI?
props: {
MuiButtonBase: {
disableRipple: buttonRippleDisable
},
MuiButton: {
disableElevation: buttonElevationDisable
},
MuiCheckbox: {
icon: CheckCircleOutline,
}
}
In MUI v5
const theme = createMuiTheme({
components: {
MuiCheckbox: {
defaultProps: {
icon: {YOUR ICON},
checkedIcon: {YOUR ICON}
}
}
}
});
yes. pass the icon in props
object in theme as you've done above.
const theme = createMuiTheme({
props:{
MuiCheckbox:{
icon: <FavoriteBorder />,
checkedIcon:<Favorite />
}
}
});
Now wherever you use the checkbox in the scope of this theme, you'll get this icon by default.
Working demo:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With