Tonic UI
Getting StartedColor ModeColor StyleVersionsContributing
THEME
BordersBreakpointsColorsOutlinesPositionsSpacingSizesShadowsTypography
BUILDING BLOCKS
BoxControlBox
UTILITIES

Stack

Stack is a layout utility component that makes it easy to stack items together and apply a space between them.

Import

Usage

By default, each item is stacked vertically. Stack clones it's children and passes the spacing to them using the margin property.

direction PropItem Spacing
columnmargin-bottom
column-reversemargin-top
rowmargin-right
row-reversemargin-left

Vertically stacked items

EDITABLE EXAMPLE

Vertically stacked items in reverse order

EDITABLE EXAMPLE

Horizontally stacked items

EDITABLE EXAMPLE

Horizontally stacked items in reverse order

EDITABLE EXAMPLE

Props

NameTypeDefaultDescription
directionstring'column'The direction to stack the items. One of: 'column', 'column-reverse', 'row', 'row-reverse'
spacingnumber | string0The space between each stack item.
shouldWrapChildrenbooleanfalseIf true, the children will be wrapped in a Box with display: inline-block, and the Box will take the spacing props.