Grid

Full CSS Grid control — template columns/rows/areas, gaps, auto-flow. Pair with GridItem for span and area placement.

HeroSpans the first two columns of row 1.
SidebarSingle column, spans rows 1 and 2.
MainTwo columns, row 2.
FooterSpans all three columns.

Usage

import { Grid, GridItem } from '@bwo-ui/react';

<Grid
  templateAreas={[
    'hero hero side',
    'main main side',
    'foot foot foot',
  ]}
  templateColumns="1fr 1fr 220px"
  templateRows="110px 130px 70px"
  gap={12}
>
  <GridItem area="hero">Hero</GridItem>
  <GridItem area="side">Sidebar</GridItem>
  <GridItem area="main">Main</GridItem>
  <GridItem area="foot">Footer</GridItem>
</Grid>

Tip: GridItem doesn't style its own box — wrap your content in a Card (or any element with a background/border) so each cell is visible. Add templateRows when you want explicit row heights; otherwise rows are sized to their content.

Props — Grid

PropTypeDefaultDescription
templateColumnsstring | responsiveCSS grid-template-columns.
templateRowsstring | responsiveCSS grid-template-rows.
templateAreasstring[]One row per string (auto-wrapped in quotes).
columnsnumber | responsiveConvenience: repeat(N, 1fr).
rowsnumber | responsiveConvenience: repeat(N, auto).
autoFlow'row' | 'column' | 'dense' | 'row dense' | 'column dense'grid-auto-flow.
autoRowsstring | numbergrid-auto-rows.
autoColumnsstring | numbergrid-auto-columns.
gap / columnGap / rowGapstring | numberSpacing controls.

Props — GridItem

PropTypeDefaultDescription
colSpan / rowSpannumberspan N tracks.
colStart / colEndnumberGrid line placement.
rowStart / rowEndnumberGrid line placement.
areastringNamed grid-area (must match templateAreas).