Grid

A component for creating grid layouts.

Use these props to create grid layouts.

PropTypeDefault
displayResponsive<"none" | "inline-grid" | "grid">"grid"
columnsResponsive<Union<string, "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>"1"
rowsResponsive<Union<string, "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
flowResponsive<"row" | "column" | "dense" | "row-dense" | "column-dense">
alignResponsive<"start" | "center" | "end" | "baseline" | "stretch">"stretch"
justifyResponsive<"start" | "center" | "end" | "between">"start"
gapResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
gapXResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
gapYResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>

The following props are shared between Box, Container, Flex, Grid, and Section layout components.

PropTypeDefault
positionResponsive<"static" | "relative" | "absolute" | "fixed" | "sticky">
insetResponsive<Union<string, "-9" | "-8" | "-7" | "-6" | "-5" | "-4" | "-3" | "-2" | "-1" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
topResponsive<Union<string, "-9" | "-8" | "-7" | "-6" | "-5" | "-4" | "-3" | "-2" | "-1" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
bottomResponsive<Union<string, "-9" | "-8" | "-7" | "-6" | "-5" | "-4" | "-3" | "-2" | "-1" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
leftResponsive<Union<string, "-9" | "-8" | "-7" | "-6" | "-5" | "-4" | "-3" | "-2" | "-1" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
rightResponsive<Union<string, "-9" | "-8" | "-7" | "-6" | "-5" | "-4" | "-3" | "-2" | "-1" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
pResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
pyResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
pxResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
ptResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
pbResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
plResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
prResponsive<Union<string, "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">>
widthResponsive<string>
minWidthResponsive<string>
maxWidthResponsive<string>
heightResponsive<string>
minHeightResponsive<string>
maxHeightResponsive<string>
gridColumnResponsive<string>
gridColumnStartResponsive<string>
gridColumnEndResponsive<string>
gridRowResponsive<string>
gridRowStartResponsive<string>
gridRowEndResponsive<string>
flexShrinkResponsive<Union<string, "0" | "1">>
flexGrowResponsive<Union<string, "0" | "1">>

This component is based on the div element and also supports common margin props m, mx, my, ml, mr, mt, mb. View source

Use the columns prop to set the number of columns in a grid. You can change this across breakpoints using the object syntax.

The columns prop creates equally sized columns. If you need to fine-tune the column sizes, use an inline style prop.

Single Sign-On

Integrate with any IdP

Directory Sync

Manage user directories

Use the flow prop to control how the auto-placed items flow in the grid. You can change this across breakpoints using the object syntax.

ADFSSAMLADPOIDCAuth0SAMLAzureSAMLCASSAMLClassLinkSAMLCyberArkSAMLDuoSAMLGenericOIDCDuoSAMLGenericSAMLGoogleOAuthGoogleSAML

Use the align prop to set the vertical alignment of the grid items. Use the justify prop to control how space is distributed between items horizontally.

You can change the values across breakpoints using the object syntax.

We do not plan to implement props for align-self and justify-self. UI code tends to be easier to understand and debug when parent components control the layout. Nesting Flex elements is the way to go when you need different alignment within one container.

Use the gap prop to set spacing between grid items. You can change the gap across breakpoints using the object syntax.