Skip to content
Browse documentation
whisk/ui

StackRow

Arrange related content horizontally.

Overview

StackRow is the portable horizontal layout primitive for related items. It uses a row direction, a gap of 4, and centered cross-axis alignment; wrapping is off unless you set wrap.

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

Use when

Related items belong in one horizontal row, often a small set of actions.

Use instead

Use ButtonGroup when the items are related buttons that should share group treatment.

Usage

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

<StackRow gap={3}>
  <Button>Save</Button>
  <Button variant="secondary">Cancel</Button>
</StackRow>

Examples

Distribution

Use justify="between" when the row should place one item at each edge of its available width.

Status

Ready

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

<StackRow justify="between" gap={3}>
  <Text weight="semibold">Status</Text>
  <Text color="subtle">Ready</Text>
</StackRow>

Align

Use align="baseline" when text of different sizes should share a typographic baseline instead of being centered by their boxes.

42

open issues

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

<StackRow align="baseline" gap={2}>
  <Text textStyle="h3">42</Text>
  <Text color="subtle">open issues</Text>
</StackRow>

Wrap

Set wrap when an action row or compact set can exceed the available width. Use Stack when the design should become a vertical sequence at a breakpoint.

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

<StackRow wrap gap={3}>
  <Button>Invite members</Button>
  <Button variant="secondary">Manage roles</Button>
  <Button variant="secondary">View audit log</Button>
</StackRow>

ButtonGroup

When related actions should look like one attached group, use ButtonGroup instead.

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

<ButtonGroup>
  <Button variant="secondary">Copy</Button>
  <Button variant="secondary">Duplicate</Button>
  <Button variant="secondary">Archive</Button>
</ButtonGroup>

Props

Component props

PropTypeDefaultDescription
gapResponsive<SpacingStep>4Set the space between sibling items from the spacing scale.
alignResponsive<start | center | end | stretch | baseline>centerAlign children vertically across the row.
justifyResponsive<start | center | end | between | around | evenly>startDistribute children horizontally along the row.
wrapResponsive<boolean>falseAllow items to move onto another line when the row runs out of inline space.

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

StackRow renders a layout div, not a list, group, or toolbar. Preserve the DOM order and use semantic children. A row of actions still needs clear button labels and a logical tab order; use ButtonGroup when the buttons should be presented as one grouped control.