Skip to content

Commit 1cfe23e

Browse files
authored
[docs][material-ui][Grid] Update grid migration guide (#46057)
1 parent 10a62ed commit 1cfe23e

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
@@ -388,6 +388,20 @@ These updates may lead to unexpected changes to your app's layout.
388388
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.
389389
:::
390390

391+
#### Container width
392+
393+
The updated Grid component doesn't grow to the full width of the container by default.
394+
If you need the grid to grow to the full width, you can use the `sx` prop:
395+
396+
```diff
397+
-<Grid container>
398+
+<Grid container sx={{ width: '100%' }}>
399+
400+
// alternatively, if the Grid's parent is a flex container:
401+
-<Grid container>
402+
+<Grid container sx={{ flexGrow: 1 }}>
403+
```
404+
391405
### ListItem
392406

393407
`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)