Skip to content
NativeScript Unified

NativeScript views

StackLayout

<StackLayout> arranges its children in one line. On the web it becomes a flex container.

AttributeValuesResult
orientationvertical (default), horizontalflex-direction: column or row

Vertical (default)

One
Two
Three

Horizontal

One
Two
Three

The polyfill writes display and flex-direction onto the element and re-applies them when the attribute changes.

HTML-first equivalent

<StackLayout> is a flex container, so a plain div with flex classes does the same job:

One
Two
Three

Use flex flex-col for the default vertical orientation. See Layout with flex and grid.