Skip to content
Browse documentation
whisk/ui

StackCol

Arrange related content vertically.

Overview

StackCol is the portable vertical layout primitive for grouped content. It uses a column direction, a gap of 4, and stretched cross-axis alignment; wrapping is off unless you set wrap.

Compare the layout primitives in the Choose a layout component table.

Use when

A title, description, form fields, or supporting content belong in a fixed vertical sequence.

Use instead

Use Stack when the direction may need to change responsively, or StackRow when the layout is always horizontal.

Usage

Project name

Visible to your team.

import { StackCol, Text } from "@smoothie-framework/whisk-react";

<StackCol gap={2}>
  <Text weight="semibold">Project name</Text>
  <Text color="subtle">Visible to your team.</Text>
</StackCol>

Examples

Align

Children stretch across the column by default. Set align="start" when compact controls should retain their intrinsic width.

import { Button, StackCol } from "@smoothie-framework/whisk-react";

<StackCol align="start" gap={3}>
  <Button>Invite members</Button>
  <Button variant="secondary">Manage roles</Button>
</StackCol>

Form fields

Use StackCol to keep related fields in a readable vertical rhythm. Each Field still owns its accessible label and validation relationship.

Used in invitations and notifications.
Shown to workspace members.
import { Field, StackCol, TextInput } from "@smoothie-framework/whisk-react";

<StackCol gap={4}>
  <Field label="Workspace name" description="Used in invitations and notifications.">
    <TextInput name="workspace-name" />
  </Field>
  <Field label="Team name" description="Shown to workspace members.">
    <TextInput name="team-name" />
  </Field>
</StackCol>

Dividers

StackCol does not add separators. When headings already establish the sections, use a decorative Divider for the visible rule.

Notifications

Choose where this workspace can contact you.

Privacy

Control who can see workspace activity.

import { Divider, Heading, StackCol, Text } from "@smoothie-framework/whisk-react";

<StackCol gap={3}>
  <Heading level={4} size="sm">Notifications</Heading>
  <Text color="subtle">Choose where this workspace can contact you.</Text>
  <Divider decorative />
  <Heading level={4} size="sm">Privacy</Heading>
  <Text color="subtle">Control who can see workspace activity.</Text>
</StackCol>

Props

Component props

PropTypeDefaultDescription
gapResponsive<SpacingStep>4Set the space between sibling items from the spacing scale.
alignResponsive<start | center | end | stretch | baseline>stretchAlign children horizontally across the column.
justifyResponsive<start | center | end | between | around | evenly>startDistribute children vertically along the column.
wrapResponsive<boolean>falseAllow another column only when the container has a constrained block size; this is uncommon for ordinary content.

Shared props

PropSupportedNotes
as / asChildYesChoose the rendered host with as, or merge the component props into one child with asChild.
Style propsYesUse the shared static style-prop surface. See Style props.
className / styleYesApplied to the rendered host.
refYesForwards to the rendered host.
Native HTML attributesYesNative attributes are forwarded to the rendered host.

Accessibility

StackCol renders a layout div, not a list, group, or landmark. Preserve the document order and use semantic children for headings, form controls, and landmarks. Insert a Divider explicitly when a visible rule marks a meaningful boundary.