Components

Stack

Vertical layout container based on flexbox column

Overview

Stack is a vertical layout container. display: flex and flex-direction: column are applied by default.

  • Polymorphic — Render as any HTML element via the as prop
  • Sprinkles support — All design token props available

It is the vertical counterpart of Inline. The API is identical.

Basic Usage

Title

Body content goes here.

Direction

First in the code, shown at the bottom

Second in the code, shown at the top

Interactive Elements

Stack is a layout container and has no hover or pressed styles. For something people click, use a component that owns its states, such as Button or IconButton.

Props

PropTypeDefaultRequiredDescription
asElementType'div'NoElement to render
direction'column' | 'column-reverse''column'NoColumn direction
gapSpace token-NoSpace between children
alignSprinkles['alignItems']-NoCross-axis alignment (align-items)
justifySprinkles['justifyContent']-NoMain-axis alignment (justify-content)
wrapSprinkles['flexWrap']'nowrap'NoWhether children wrap

Guidelines

  • Use Stack for listing form fields or arranging content inside cards
  • direction="column-reverse" is useful for reverse-scroll UIs like chat
  • Combining Inline and Stack allows building complex layouts with token-based spacing