Grid

GdsGrid is a 12-column responsive layout primitive. Use it whenever you want content to flow across columns and reflow at different screen sizes.

Two roles:

  • Container - set container and pick a spacing value to define the gap between cells.
  • Item - set size to choose how many of the 12 columns the cell occupies. Pass a number for a fixed size, or an object for a responsive size ({ xs: 12, md: 6 } = full width on mobile, half on desktop).

Usage

Responsive sizing

Pass an object to size to change the layout per breakpoint. Resize your browser to watch the grid reflow.

BreakpointMin width
xs0
sm600px
md900px
lg1200px
xl1536px

Auto and grow

  • size="auto" - the cell shrinks to fit its content.
  • size="grow" - the cell fills whatever space is left.

Offset

offset pushes a cell to the right by N columns. Combine with size to align content within the 12-column grid.

Nested grids

A grid item can itself be a container, letting you split a region of the page into a finer sub-grid.

Props