Grid

Examples

Simple Grid

span = 8
span = 4, rowSpan = 2
span = 2, rowSpan = 3
span = 2
span = 4
span = 2
span = 2
span = 2
span = 4
span = 2
span = 4
span = 4
Copied to clipboard

Grid with gutters

span = 8
span = 4, rowSpan = 2
span = 2, rowSpan = 3
span = 2
span = 4
span = 2
span = 2
span = 2
span = 4
span = 2
span = 4
span = 4
Copied to clipboard

Grid With Overrides

span = 3 rowSpan= 2
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Grid Item
Copied to clipboard

Grid Playground

1
2
3
4
1
3
1
0
2
3
1
0
3
3
1
0
4
3
1
0
Copied to clipboard

Grid Props

The Grid component accepts the following props.

NameTypeRequiredDefaultDescription
children
any
nullcontent rendered inside the Grid layout
className
string
''additional classes added to the Grid layout
gutter
enum
nullAdds space between children. Options are sm, md or lg
span
custom
nullThe number of rows a column in the grid should span. Value should be a number 1-12
sm
custom
nullthe number of columns all grid items should span on a small device
md
custom
nullthe number of columns all grid items should span on a medium device
lg
custom
nullthe number of columns all grid items should span on a large device
xl
custom
nullthe number of columns all grid items should span on a xLarge device

GridItem Props

The GridItem component accepts the following props.

NameTypeRequiredDefaultDescription
children
any
nullcontent rendered inside the Grid Layout Item
className
string
''additional classes added to the Grid Layout Item
span
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item spans. Value should be a number 1-12
rowSpan
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of rows the grid item spans. Value should be a number 1-12
offset
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns a grid item is offset
sm
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item spans on small device. Value should be a number 1-12
smRowSpan
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of rows the grid item spans on medium device. Value should be a number 1-12
smOffset
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item is offset on small device. Value should be a number 1-12
md
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item spans on medium device. Value should be a number 1-12
mdRowSpan
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of rows the grid item spans on medium device. Value should be a number 1-12
mdOffset
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item is offset on medium device. Value should be a number 1-12
lg
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item spans on large device. Value should be a number 1-12
lgRowSpan
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of rows the grid item spans on large device. Value should be a number 1-12
lgOffset
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item is offset on large device. Value should be a number 1-12
xl
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item spans on xLarge device. Value should be a number 1-12
xlRowSpan
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of rows the grid item spans on large device. Value should be a number 1-12
xlOffset
enum: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
nullthe number of columns the grid item is offset on xLarge device. Value should be a number 1-12