Skip to content

Commit e08acbf

Browse files
[docs][material-ui][Grid] Update grid migration guide (@sai6855) (#46153)
Co-authored-by: sai chand <[email protected]> Co-authored-by: sai6855 <[email protected]>
1 parent da0606f commit e08acbf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/data/material/migration/upgrade-to-v6/upgrade-to-v6.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,20 @@ These updates may lead to unexpected changes to your app's layout.
331331
Still, we strongly recommend adopting this new behavior rather than trying to replicate the old pattern, as the new version is more predictable and modern.
332332
:::
333333

334+
#### Container width
335+
336+
The updated Grid component doesn't grow to the full width of the container by default.
337+
If you need the grid to grow to the full width, you can use the `sx` prop:
338+
339+
```diff
340+
-<Grid container>
341+
+<Grid container sx={{ width: '100%' }}>
342+
343+
// alternatively, if the Grid's parent is a flex container:
344+
-<Grid container>
345+
+<Grid container sx={{ flexGrow: 1 }}>
346+
```
347+
334348
### ListItem
335349

336350
`ListItem`'s props `autoFocus`, `button`, `disabled`, and `selected`, deprecated in v5, have been removed. To replace the `button` prop, use `ListItemButton` instead. The other removed props are available in the `ListItemButton` component as well.

0 commit comments

Comments
 (0)