Skip to content

Grid

A responsive column grid system for page layouts. Based on a 12-column grid that collapses at breakpoints.

Preview

12 columns

1
2
3
4
5
6
7
8
9
10
11
12

Common layouts

3-column (4+4+4)

col 1
col 2
col 3

2-column (6+6)

col 1
col 2

Sidebar + content (3+9)

sidebar
main content

Breakpoints

BreakpointNameColumnsGutter
≥ 1280pxxl1224 px
≥ 1024pxlg1224 px
≥ 768pxmd816 px
≥ 480pxsm416 px
< 480pxxs412 px

Props

PropTypeDefaultDescription
columnsnumber12Number of columns
gapstring--space-6Gutter spacing
childrenReact.ReactNode--Grid items

Grid.Col

PropTypeDefaultDescription
spannumber1Columns to span
smnumber--Span at sm breakpoint
mdnumber--Span at md breakpoint
lgnumber--Span at lg breakpoint

Code example

React

tsx
import { Grid } from '@thepace/lexicon/components';

<Grid columns={12} gap="var(--space-6)">
  <Grid.Col span={3}>Sidebar</Grid.Col>
  <Grid.Col span={9}>Main content</Grid.Col>
</Grid>

CSS utility

css
.my-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-6);
}

CSS class reference

ClassPurpose
.lex-gridGrid container
.lex-grid--1212-column grid
.lex-grid--88-column grid
.lex-grid--44-column grid
.lex-grid__colGrid column item

Guidelines

Do

  • Use the 12-column grid for complex dashboard layouts.
  • Collapse to fewer columns at smaller breakpoints.
  • Use consistent gutter spacing from the spacing scale.

Don't

  • Don't nest grids more than 2 levels deep.
  • Don't mix grid and flex layout within the same container.

Released under the MIT License. A product by the pace.