NUI / Components / Layout

Column

ImplementedLayout

Column arranges children vertically.

Supported as a vertical layout container.

Overview

Column arranges children vertically.

When to use

  • Forms.
  • Stacked labels.
  • Vertical menus.
  • Settings panels.
  • Grouped content.

Children

Supports normal children.

nui
children {
    Text ChildText {
        text: "THIS IS THE CHILD COMPONENT"
    }
}

Basic syntax

nui
Column SettingsColumn {
    gap: 8

    children {
        Text ChildText {
            text: "THIS IS THE CHILD COMPONENT"
        }
    }
}

Supported properties

PropertyTypeRequiredDefaultDescription
gapnumberNo0Space between children.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
paddingmarginNomargin(0)Inner padding.
childPaddingmarginNomargin(0)Padding around children.
backgroundColorcolorNoTransparentOptional background color.
horizontalAlignenumNoInheritedComponent horizontal alignment.
verticalAlignenumNoInheritedComponent vertical alignment.
contentHorizontalAlignenumNoInheritedChild horizontal alignment.
contentVerticalAlignenumNoInheritedChild vertical alignment.
opacitynumberNo1Render opacity.
layerintegerNoContext defaultLayer order inside layered parents.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

Column may receive stack, canvas, grid, wrap, or ExpandableArea slot properties only when it is authored as a direct child of the matching parent. Children of Column may use fill or auto. See section 7.

Full syntax example

nui
Column SettingsColumn {
    gap: 8
    width: 320
    height: 480
    padding: margin(12)
    childPadding: margin(2)
    backgroundColor: "#0F172A"
    horizontalAlign: fill
    verticalAlign: top
    contentHorizontalAlign: fill
    contentVerticalAlign: top
    opacity: 1
    layer: 1
    visible: true

    children {
        Text ChildText {
            text: "THIS IS THE CHILD COMPONENT"
        }
    }
}

Limitations

  • Use Row for horizontal layout.
  • Use StackBox when the layout direction should be configured by property.