Skip to content

<sessions-grid>

Equal columns that stack on a narrow container.

Preact & React<Grid>GroupLayoutDrawn asGrid

Preview

Drawn by the same renderers Sessions uses for your extension, from the DOM example beside it, without its event handlers.

When to use it

A grid of 2, 3 or 4 columns. Set min-column-width instead to fit as many columns as the space allows and collapse to one column on a phone.

In Preact and React, import the component of the same name from @sessions/apps/preact or @sessions/apps/react. Attributes become camelCase props, a boolean attribute is a boolean prop, and an event is an on prop that receives the event’s detail.

Attributes

Attribute
columns
A fixed number of columns.234Prop columns
gap
Space between children.nonesmallbaselargeProp gap
min-column-width
A CSS length; when set, the grid fits as many columns as will fit.Prop minColumnWidth
Example
import {Grid, Text} from '@sessions/apps/preact';

<Grid minColumnWidth="12rem" gap="base">
  <Text>Warm-up · 10 min</Text>
  <Text>Main set · 40 min</Text>
  <Text>Cool-down · 10 min</Text>
</Grid>

In the same group