Use to achieve no-fuss vertical centering.
A stack is made of flexible items that wrap each of the stack’s children. Options provide control of the alignment and spacing of the items in the stack.
StackItem to group multiple elements inside a
optional = ?
||Specifies the inline alignment. This affects the horizontal flow of elements. Default value:
||Adjusts spacing between children. Default value:
- 📱 All children of
BlockStackare placed in a single view object, which makes recycling the views expensive and results in poorer performance when scrolling. Consider keeping your Stacks simple.
- By default,
|✅ Do||🛑 Don't|
|Keep Stacks narrow. There is typically more vertical space than horizontal||Use complex and deep Stack layouts|
For more guidelines, refer to Polaris' Stack best practices.