Skip to main content

Stack

Stack is a container-type control that allows to define the layout of its children controls.

Although the Stack control has a number of different properties, there are three in particular that define the overall layout that the component has:

  • Direction: Refers to whether the stacking of children components is horizontal or vertical. By default the Stack control is vertical, but can be turned horizontal by adding horizontal property when using the control.
  • Alignment: Refers to how the children controls are aligned inside the container. This is controlled via verticalAlign and horizontalAlign properties.
  • Spacing: Refers to the space that exists between children controls inside the Stack. This is controlled via gap property.

Stacks can be nested inside one another in order to be able to configure the layout of the application as desired.

Examples

Properties

NameTypeDefaultDescription
horizontalboolfalseDefines whether to render Stack children horizontally.
verticalFillboolfalseDefines whether the Stack should take up 100% of the height of its parent.
horizontalAlignstringDefines how to align stack children horizontally: start, end, center, space-between, space-around, space-evenly, baseline or stretch.
verticalAlignstringDefines how to align stack children vertically: start, end, center, space-between, space-around, space-evenly, baseline or stretch.
minWidthstringThe minimum stack width.
maxWidthstringThe maximum stack width.
minHeightstringThe minimum stack height.
maxHeightstringThe maximum stack height.
gapstringA gap between stack child controls.
wrapboolfalseDefines whether Stack children should wrap onto multiple rows or columns when they are about to overflow the size of the Stack.
bgcolorstringStack background color.
borderstringBorder around stack in <width> <style> <color> format, e.g. 1px solid #550000
borderRadiusstringBorder radius.
borderLeftstringBorder of the left side of stack in <width> <style> <color> format, e.g. 1px solid #550000
borderRightstringBorder of the right side of stack in <width> <style> <color> format, e.g. 1px solid #550000
borderTopstringBorder of the top side of stack in <width> <style> <color> format, e.g. 1px solid #550000
borderBottomstringBorder of the bottom side of stack in <width> <style> <color> format, e.g. 1px solid #550000
scrollxboolfalseEnable horizontal scrolling if stack contents doesn't fit into stack boundaries.
scrollyboolfalseEnable vertical scrolling if stack contents doesn't fit into stack boundaries.

Child controls

  • Any control - will be rendered in the body of the stack.