Open
Description
Issue
If the theme defaultProps.slotProps
defines className
and style
, they are replaced by the component's slotProps
:
// src/theme.ts
const theme = createTheme({
components: {
MuiCardHeader: {
defaultProps: {
slotProps: {
title: {
className: "text-sm",
style: {
color: "red",
},
},
},
},
},
},
});
<ThemeProvider theme={theme}>
<CardHeader
slotProps={{
title: { className: 'text-red-500', style: { background: 'blue' } },
}}
/>
</ThemeProvider>
The className
and style
from the theme are replaced by the slotProps
on the component instance.
Expected
Based on the above snippet, the CardHeader should have className text-sm text-red-500
and the style color: 'red', background: 'blue'
.
Use case
When using Material UI together and Tailwind CSS together.
Metadata
Metadata
Assignees
Projects
Status
No status