-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Unable to override default props/styling for GridActionsCellItem #7619
Comments
Thanks for opening the issue! For const theme = createTheme({
components: {
MuiDataGrid: {
styleOverrides: {
actionsCellItem: {
// ...
}
}
}
}
}); It doesn't work though, it's a bug. For the const theme = createTheme({
components: {
MuiDataGrid: {
defaultProps: {
// ...
}
}
}
}); |
Hello @Nitzperetz As for the style overrides, you can find the possible classes you can target here. You might also expect that applying the following change should produce the same result. const theme = createTheme({
components: {
MuiDataGrid: {
styleOverrides: {
- root: {
+ actionsCell: {
- [`.${gridClasses.actionsCell}`]: {
backgroundColor: "red"
- }
}
}
}
}
}); But that is not the case, because the given component isn't a As with anything, it's best to explain your case with as clear examples as possible. It's always perfect if you provide a codesandbox with what is the end goal you are trying to achieve. |
@LukasTy I think this should work: styleOverrides: {
actionsCell: {
backgroundColor: "red"
}
} The same way as this works: https://codesandbox.io/s/tender-bird-vikzq5?file=/demo.tsx styleOverrides: {
row: {
backgroundColor: "red"
}
}
I don't think it's related to |
Yes, sorry for not expressing myself correctly. For named style overrides to work they need to be consumed by any |
Makes sense 👍 |
Thank you all for replying!
I am in need to align GridActionsCellItem component across the app. |
Duplicates
Latest version
Steps to reproduce 🕹
Overriding theme for MuiDataGrid was added in v5.0.0, however not all DataGrid Types were added like - GridActionsCellItem
Current behavior 😯
Unable to override theme for GridActionsCellItem.
Expected behavior 🤔
Override GridActionsCellItem defaultProps and styling.
Context 🔦
Overriding the theme in MUI is a feature I use in almost every component in order to align UX/UI. The only component I wasn't able to customize is the cell item for now.
Openning this issue as requested here.
Your environment 🌎
Browser is not relevant.
Having issues with running the command. Will update the issue once it's fixed.
npx @mui/envinfo
Order ID 💳 (optional)
No response
The text was updated successfully, but these errors were encountered: