Skip to content

<sessions-stack>

A column (or row) of children with even spacing.

Preact & React<Stack>GroupLayoutDrawn asStack

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

The workhorse layout. Stacks its children top-to-bottom by default; direction="inline" lays them out left-to-right and wraps.

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
direction
Which way children flow.blockinlineProp direction
gap
Space between children.nonesmallbaselargeProp gap
align
Cross-axis alignment of children.startcenterendstretchProp align
Example
import {Stack, Text} from '@sessions/apps/preact';

<Stack gap="small">
  <Text emphasis="strong">Doors open at 6:30</Text>
  <Text emphasis="subdued">Arrive early for a good seat.</Text>
</Stack>

In the same group