Page icon

stack Layout

The stack layout is the most basic, but highly useful layout for compositing UIs.

{
  "type": "view",
  "layout": "stack",
  "padding": 8,
  "components": [
    {
      "type": "label",
      "text": "Hello World!"
    }
  ]
}

Components are added to the view with the first component at the bottom and stacked up to the last component.

Each component fills the entire space of the view, and the desired size of the container view is based on the largest added component.

Properties

padding
INTEGER
Default: 0, Range: 0-64

Inset the content around the perimeter of the view by the padding amount.

Constraints

Each component can use the shared constraints to refine their position within the layout.