structyl

Stack

stable

Arranges children in a row or column with consistent spacing.

Basic usage

OneTwo

Examples

Direction and spacing

Use column stacks for form groups and row stacks for action clusters.

DraftReviewReady

Owner

Design systems team

Action rows

Stack keeps repeated action rows predictable without introducing another layout component.

Alignment and dividers

Stack supports row/column directions, numeric spacing, wrapping and inserted dividers.

One
Two

Features

  • Row or column direction.
  • Tokenized spacing.

Installation

bash
pnpm dlx structyl add stack

API Reference

Stack

Flex stack layout.

PropTypeDefault
direction'row' | 'row-reverse' | 'column' | 'column-reverse'

Flex direction.

'column'
spacing'none' | 'xs' | 'sm' | 'md' | 'lg' | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8

Gap between children.

'md'
dividerReact.ReactNode

Inserted between children.

alignItems'start' | 'center' | 'end' | 'stretch' | 'baseline'

Cross-axis alignment.

justifyContent'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'

Main-axis alignment.

flexWrap'nowrap' | 'wrap' | 'wrap-reverse'

Flex wrapping behavior.

classNamestring

Additional Tailwind classes merged with the component defaults.

Stack | structyl