Beta v0.6.2

Grid

Grid

Import


import { Grid } from "pier-ui";


Grid


<Grid
columns="1fr 1fr 1fr 1fr 1fr 1fr"
columnGap="10px"
height="90px"
rows="90px auto 10px"
>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</Grid>



1
2
3
4

<Grid
columns="1fr 1fr 1fr 1fr"
columnGap="10px"
rows="90px auto 10px"
rowGap="6px"
className="my-custom-class"
height="90px"
>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
</Grid>

Media Queries


<Grid
columns="1fr"
columnGap="10px"
rows="1fr 1fr 1fr 1fr"
rowGap="30px"
className="my-custom-class"
height="140px"
xs={{
columns: "1fr 1fr",
height: "140px",
rows: "30px 30px",
rowGap: "30px",
}}
md={{
columns: "1fr 1fr 1fr",
height: "140px",
rows: "30px 30px",
rowGap: "30px",
}}
lg={{
columns: "1fr 1fr 1fr 1fr",
columnGap: "50px",
rows: "50px 10px",
}}
>
<div style={{ backgroundColor: "peachpuff" }}></div>
<div style={{ backgroundColor: "palegreen" }}></div>
<div style={{ backgroundColor: "peachpuff" }}></div>
<div style={{ backgroundColor: "palegreen" }}></div>
</Grid>



Props

PropDescriptionTypeDefault
classNameclassName for the componentstring
bgColorbackground color for the componentstring
maxWidthmaxWidth of the containerstringauto
asYou can use a custom element type for this component.elementTypediv
columnscss grid: grid-template-columnsstring
autoColumnscss grid: grid-auto-columnsstring
rowscss grid: grid-template-rowsstring
rowGapgrid-row-gapstring
autoRowsgrid-auto-rowsstring
areasgrid-template-areasstring
autoFlowgrid-auto-flowstring
heightheight of the gridstring
xsGrid property for breakpoint min. xsobject
mdGrid property for breakpoint min. mdobject
lgGrid property for breakpoint min. lgobject
xlGrid property for breakpoint min. xlobject