NUI / Components / Common

Spacer

ImplementedCommon / Layout

Spacer creates empty space in a layout.

Supported as an empty layout spacer.

Overview

Spacer creates empty space in a layout.

When to use

  • Use Spacer to add fixed space or consume flexible space in row, column, stack, and scroll layouts.

Children

Does not support children.

Basic syntax

nui
Spacer Gap {
    height: 12
}

Supported properties

PropertyTypeRequiredDefaultDescription
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
minWidthnumberNoUnsetMinimum width.
minHeightnumberNoUnsetMinimum height.
maxWidthnumberNoUnsetMaximum width.
maxHeightnumberNoUnsetMaximum height.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

Spacer commonly uses fill or auto when it is a direct child of a stack-like parent. It may also receive canvas, grid, wrap, or ExpandableArea slot properties in matching parent contexts. See section 7.

Full syntax example

nui
Spacer Gap {
    width: 16
    height: 12
    minWidth: 8
    minHeight: 8
    maxWidth: 40
    maxHeight: 40
    visible: true
}

Limitations

  • Spacer is intentionally invisible.
  • Flexible sizing belongs in contextual stack child properties, not in normal top-level syntax.