For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/components/stack.md.
v0.0.57
  • English
  • Stack

    Layout@rockshin/tao-ui

    Composes children in a flex row or column with consistent spacing.

    When to use

    Use Stack for simple one-dimensional layout and spacing.

    Recommended

    • Prefer Stack over one-off margin rules for repeated spacing.
    • Use semantic containers when the layout has richer meaning.
    • Pass breakpoint maps (for example, direction={{ xs: 'vertical', md: 'horizontal' }}) for responsive layouts.

    Avoid

    • Do not use the component outside its intended interaction model.

    Examples

    Basic usage

    DesignEngineeringResearch
    TSX

    Direction, spacing, and alignment

    Small gapCentered
    Large gapEnd aligned
    TSX

    Responsive direction

    TSX

    Alignment

    Use align and justifyContent on the root to position children.

    Centered vertically
    TSX

    Wrapping items

    Enable flexWrap on the semantic root so a long toolbar can wrap.

    TSX

    Responsive direction and gap

    Use a vertical arrangement in narrow viewports and horizontal at wider breakpoints. Compare the phone preview.

    390 × 640
    TSX

    Nested layouts

    Let the outer stack space sections and the inner stack group related actions.

    Workspace

    Invite members and manage access.

    TSX

    API

    Stack

    PropertyDescriptionTypeDefault Value
    directionFlex direction. Accepts a breakpoint map, e.g. direction={{ xs: 'vertical', md: 'horizontal' }} — the largest matching breakpoint wins (SSR/first render falls back to the plain default).TaoResponsiveValue<StackDirection> | undefinedvertical
    classNameAdditional css classstring | undefined-
    styleAdditional styleCSSProperties | undefined-