Skip to main content

Grid

Quick start

Here's a quick start guide to get started with the Grid component

Importing Grid

import { Grid } from "@hover-design/react";

Code Snippets and Examples

Grid Default

<Grid>
<div>Grid 1</div>
<div>Grid 2</div>
</Grid>
Grid 1
Grid 2

Grid Template Columns

<Grid columnGap="12px" gridTemplateColumns="200px 200px 200px">
<div>Grid 1</div>
<div>Grid 2</div>
<div>Grid 3</div>
<div>Grid 4</div>
<div>Grid 5</div>
</Grid>
Grid 1
Grid 2
Grid 3
Grid 4
Grid 5

Grid Template Rows

<Grid gap="12px" gridTemplateRows="200px 200px 200px">
<div>Grid 1</div>
<div>Grid 2</div>
<div>Grid 3</div>
<div>Grid 4</div>
<div>Grid 5</div>
</Grid>
Grid 1
Grid 2
Grid 3
Grid 4
Grid 5

Other properties

<Grid
columnGap="12px"
gridAutoRows="100px"
gridTemplateColumns="repeat(3, 1fr)"
gap="20px"
>
<div>Grid 1</div>
<div>Grid 2</div>
<div>Grid 3</div>
<div>Grid 4</div>
<div>Grid 5</div>
<div>Grid 6</div>
<div>Grid 7</div>
</Grid>
Grid 1
Grid 2
Grid 3
Grid 4
Grid 5
Grid 6
Grid 7

Props Referece

AttributesValuesOptional ?
gapgap CSS properties Yes
columnGapcolumn-gap CSS properties Yes
rowGaprow-gap CSS propertiesYes
display"grid" or "inline-grid" or "block grid" or "inline grid"Yes
gridAutoRowsgrid-auto-rows CSS propertiesYes
gridAutoColumnsgrid-auto-columns CSS propertiesYes
gridTemplateColumnsgrid-template-columns CSS propertiesYes
gridTemplateRowsgrid-template-rows CSS propertiesYes
gridTemplateAreasgrid-template-areas CSS propertiesYes
gridAutoFlowgrid-auto-flow CSS propertiesYes
gridRowgrid-row CSS propertiesYes
gridColumngrid-column CSS propertiesYes
gridAreagrid-area CSS properties Yes
gridRowStartgrid-row-start CSS propertiesYes
gridRowEndgrid-row-end CSS propertiesYes
gridColumnStartgrid-column-start CSS propertiesYes
gridColumnEndgrid-column-end CSS propertiesYes
justifyItemsjustify-items CSS propertiesYes
justifyContentjustify-content CSS propertiesYes
justifySelfjustify-self CSS propertiesYes
alignItemsalign-items CSS propertiesYes
alignContentalign-content CSS propertiesYes
alignSelfalign-self CSS propertiesYes
placeItemsplace-items CSS propertiesYes
placeContentplace-content CSS propertiesYes
placeSelfplace-self CSS propertiesYes
gridgrid CSS properties Yes
gridTemplategridTemplate CSS propertiesYes