-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[data grid] Adjust the width of Column Menu and filter modal of that filter option #12570
Comments
Hey @Here2Huynh could you try setting the width property to <DataGridPro
rows={[]}
columns={columns}
componentsProps={{
columnMenu: {
// sx: {
// backgroundColor: "orange",
// },
},
basePopper: {
sx: {
"& .MuiPaper-root": {
- width: 100,
+ width: '100%',
},
},
},
}}
/> |
Hi @michelengelen , tried it with This is easier shown in this screenshot with width at I think I am looking for a class name that encompasses the whole filter modal so I can select and change via CSS. |
There is one way to apply custom styles to the filterPanel: slotProps={{
filterPanel: {
sx: {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
padding: '5px',
borderRadius: '4px',
},
},
}} The filterPanel can take an You can also target specific elements within with the import { gridClasses } from '@mui/x-data-grid';
...
<DataGrid
...
slotProps={{
filterPanel: {
sx: {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
padding: '5px',
borderRadius: '4px',
[`& .${gridClasses.filterForm}`]: {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
padding: '5px',
borderRadius: '4px',
},
},
},
}}
/> There are multiple classes that ca be used from that object. Does that help in your case? |
Ah, it's the |
How did we do @Here2Huynh? |
Duplicates
Similar to this but this answer seems to have changed.
Also, have added on to this feature request.
Latest version
I have tested the latest version. I am on "6.19.8".
Summary 💡
I would like some help with adjusting the column menu and filter modal width so it can look better in mobile.
Examples 🌈
Currently, it looks like this. Which is not very mobile friendly.
Even with the suggestion from this ticket. The width of the popper is adjusted but not the whole modal component. Which extends to its default width as shown in the screenshot.
Code:
Motivation 🔦
Mobile responsiveness for data grid's option menu.
Order ID 💳 (optional)
No response
Search keywords:
The text was updated successfully, but these errors were encountered: