Grid
Utilities for controlling CSS Grid layouts.Import
API
FromcssGrid/cssGrid.js:98-113:
Gap Properties
gap
Set gap between grid items (with spacing scale):cssGrid.js:9-19:
columnGap
Set horizontal gap between columns:cssGrid.js:27-37:
rowGap
Set vertical gap between rows:cssGrid.js:46-56:
Template Properties
gridTemplateColumns
Define column structure:cssGrid.js:82-84:
gridTemplateRows
Define row structure:cssGrid.js:86-88:
gridTemplateAreas
Define named grid areas:cssGrid.js:90-92:
Item Placement
gridColumn
Control column span and placement:cssGrid.js:62-64:
gridRow
Control row span and placement:cssGrid.js:66-68:
gridArea
Place item in named area or specify row/column:cssGrid.js:94-96:
Auto Properties
gridAutoFlow
Control how auto-placed items flow:cssGrid.js:70-72:
gridAutoColumns
Size implicitly-created columns:cssGrid.js:74-76:
gridAutoRows
Size implicitly-created rows:cssGrid.js:78-80:
Common Patterns
Basic Grid Layout
Responsive Grid
Card Grid
Dashboard Layout
Magazine Layout
Image Gallery
Holy Grail Layout
With sx Prop
TypeScript
Available Properties
| Prop | CSS Property | Theme Key | Transform |
|---|---|---|---|
gap | gap | spacing | createUnaryUnit |
columnGap | column-gap | spacing | createUnaryUnit |
rowGap | row-gap | spacing | createUnaryUnit |
gridColumn | grid-column | - | - |
gridRow | grid-row | - | - |
gridAutoFlow | grid-auto-flow | - | - |
gridAutoColumns | grid-auto-columns | - | - |
gridAutoRows | grid-auto-rows | - | - |
gridTemplateColumns | grid-template-columns | - | - |
gridTemplateRows | grid-template-rows | - | - |
gridTemplateAreas | grid-template-areas | - | - |
gridArea | grid-area | - | - |