--- 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. Stacks always wrap the content to the next column or row. api_version: 2025-07 api_name: pos-ui-extensions source_url: html: 'https://shopify.dev/docs/api/pos-ui-extensions/2025-07/components/stack' md: 'https://shopify.dev/docs/api/pos-ui-extensions/2025-07/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. Stacks always wrap the content to the next column or row. ## Stack * alignContent 'stretch' | ContentPosition | ContentDistribution Default: 'start' Aligns the Stack along the cross axis. * alignItems 'stretch' | 'baseline' | ContentPosition Default: 'stretch' Aligns the Stack's children along the cross axis. * blockSize SizeUnitsOrAuto Default: 'auto' Adjust the block size. Auto takes the block size of the box's children. * columnGap SpacingKeyword | '' Default: '' - meaning no override Adjust spacing between elements in the inline axis. This overrides the column value of `gap`. * direction 'inline' | 'block' | DeprecatedStackDirection Default: 'inline' Sets how the Stack's children are placed within the Stack. 'vertical' and 'horizontal' are deprecated. Using these values will use the Stack implementation from 2024-10. * flex number The flex value for the stack. Flex 1 will stretch the stack to fill the parent. * flexChildren boolean Whether the children should be stretched to fill the cross axis. * gap SpacingKeyword Default: '0' The size of the gap between each child in the stack. * inlineSize SizeUnitsOrAuto Default: 'auto' Adjust the inline size. Auto takes the inline size of the box's children. * justifyContent ContentPosition | ContentDistribution Default: 'start' Aligns the Stack along the main axis. * maxBlockSize SizeUnitsOrNone Default: 'none' Adjust the maximum block size. * maxInlineSize SizeUnitsOrNone Default: 'none' Adjust the maximum inline size. * minBlockSize SizeUnits Default: '0' Adjust the minimum block size. * minInlineSize SizeUnits Default: '0' Adjust the minimum inline size. * padding PaddingKeys Default: '0' Adjust the padding of all edges in pixels. * paddingBlock PaddingKeys Default: '0' Adjust the block-padding. This overrides the block value of `padding`. * paddingBlockEnd PaddingKeys Default: '0' Adjust the block-end padding. This overrides the block-end value of `paddingBlock`. * paddingBlockStart PaddingKeys Default: '0' Adjust the block-start padding. This overrides the block-start value of `paddingBlock`. * paddingInline PaddingKeys Default: '0' Adjust the inline padding. This overrides the inline value of `padding`. * paddingInlineEnd PaddingKeys Default: '0' Adjust the inline-end padding. This overrides the inline-end value of `paddingInline`. * paddingInlineStart PaddingKeys Default: '0' Adjust the inline-start padding. This overrides the inline-start value of `paddingInline`. * rowGap SpacingKeyword | '' Default: '' - meaning no override Adjust spacing between elements in the block axis. This overrides the row value of `gap`. * alignment ContentPosition | ContentDistribution Default: 'flex-start' deprecated The alignment of the children along the main axis. Deprecated Use the `justifyContent` prop instead. * flexWrap 'wrap' | 'nowrap' | 'wrap-reverse' deprecated Wrap behavior for the children of the stack. Deprecated Has no effect, content will always wrap. * paddingHorizontal HorizontalSpacing deprecated The horizontal padding around the stack. Deprecated Use the `paddingInline` prop instead. * paddingVertical VerticalSpacing deprecated The vertical padding around the stack. Deprecated Use the `paddingBlock` prop instead. * spacing Spacing Default: 1 deprecated The spacing between each child in the stack. Deprecated Use the `gap` prop instead. ### ContentPosition ```ts 'center' | 'start' | 'end' ``` ### ContentDistribution ```ts 'space-around' | 'space-between' | 'space-evenly' ``` ### SizeUnitsOrAuto ```ts SizeUnits | 'auto' ``` ### SizeUnits ```ts `${number}px` | `${number}%` | `0` ``` ### SpacingKeyword ```ts SizeKeyword | 'none' ``` ### SizeKeyword SizeKeyword maps to predetermined values in POS. ```ts '0' | '025' | '050' | '100' | '200' | '250' | '300' | '350' | '400' | '450' | '500' | '600' | '700' | '800' | '900' | '1000' | '1100' | '1200' | '1400' | '1800' | '2000' ``` ### DeprecatedStackDirection ```ts 'vertical' | 'horizontal' ``` ### SizeUnitsOrNone ```ts SizeUnits | 'none' ``` ### PaddingKeys ```ts SizeKeyword | 'none' ``` ### HorizontalSpacing ```ts 'HalfPoint' | 'ExtraSmall' | 'Small' | 'Medium' | 'Large' | 'ExtraLarge' | 'ExtraExtraLarge' ``` ### VerticalSpacing ```ts 'HalfPoint' | 'ExtraSmall' | 'Small' | 'Medium' | 'Large' | 'ExtraLarge' ``` ### Spacing ```ts 0.5 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 16 ``` ### Examples * #### Stack ##### React ```tsx import { reactExtension, Button, Stack, Screen, } from '@shopify/ui-extensions-react/point-of-sale'; import React from 'react'; export default reactExtension('pos.home.modal.render', () => (