--- title: Stack description: >- A container for other components that allows them to be stacked horizontally or vertically. When building complex UIs, this will be your primary building block. api_version: 2024-04 api_name: pos-ui-extensions source_url: html: 'https://shopify.dev/docs/api/pos-ui-extensions/2024-04/components/stack' md: 'https://shopify.dev/docs/api/pos-ui-extensions/2024-04/components/stack.md' --- # Stackcomponent A container for other components that allows them to be stacked horizontally or vertically. When building complex UIs, this will be your primary building block. ## Stack * direction "vertical" | "horizontal" required The direction of the stack. * alignment "flex-end" | "center" | "flex-start" | "space-around" | "space-between" | "space-evenly" Default: 'flex-end' The alignment of the children along the cross axis. * paddingVertical VerticalSpacing The vertical padding around the stack. * paddingHorizontal HorizontalSpacing The horizontal padding around the stack. * spacing Spacing Default: 1 The spacing between each child in the stack. * flexChildren boolean Whether the children should be stretched to fill the cross axis. * flex number The flex value for the stack. * flexWrap "wrap" | "nowrap" | "wrap-reverse" Wrap behavior for the children of the stack. ### VerticalSpacing ```ts 'HalfPoint' | 'ExtraSmall' | 'Small' | 'Medium' | 'Large' | 'ExtraLarge' ``` ### HorizontalSpacing ```ts 'HalfPoint' | 'ExtraSmall' | 'Small' | 'Medium' | 'Large' | 'ExtraLarge' | 'ExtraExtraLarge' ``` ### Spacing ```ts 0.5 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 16 ``` ### Examples * #### Stack ##### React ```tsx