Componentsv2.189.1
Iconsv1.19.0
MCPv0.8.62
Tokensv0.34.3

A utility component for building CSS grid layouts.

Importing

The component can be imported via:

import { Grid } from '@customerio/pluma-components/react';
Loading editor

Columns

The columns prop accepts a number, string, or array of strings.

If the value is a number, the grid will have that many equal columns. If the value is a string, it will be set as the CSS grid-template-columns property, which defines the number and sizes of columns. If a string array is provided, it will also be used for grid-template-columns, with the values joined by a space (e.g. ['1fr', 'auto'] becomes 1fr auto).

Loading editor
Loading editor

Gap

The gap between items can be controlled with the gap prop, which accepts space token values. rowGap and columnGap are also available for more fine-grained control of the gaps.

Loading editor
Loading editor

Areas

grid-template-areas can be set via the areas prop. It accepts a string, or an array of strings, which will be mapped into one string (e.g. ["header header", "nav main", "footer footer"] turns into "header header" "nav main" "footer footer").

Loading editor

API

PlumaGrid extends Box

grid-template-areas definitions for the grid.

grid-template-columns definitions for the grid, or number of columns.

Default:grid

The display property.

Defines default justifySelf for all items in the grid. MDN Justify Items

grid-template-rows definitions for the grid.

On this page