NUI / Components / Common

Text

ImplementedCommon / Display

Text renders a single text label in Unreal-native UI.

Supported as the current NUI Script V2 text display component.

Overview

Text renders a single text label in Unreal-native UI.

When to use

  • Labels.
  • Captions.
  • Button-like text that is not itself interactive.
  • Counters.
  • Headings.
  • Status text.

Children

Does not support children.

Basic syntax

nui
Text Title {
    text: "Inventory"
}

Supported properties

PropertyTypeRequiredDefaultDescription
textstringYesEmptyText content to render.
fontstringNoProject defaultFont resource name.
fontSizenumberNo14Text size.
colorcolorNoInherited/defaultText color.
textAlignenumNoleftHorizontal text alignment.
verticalTextAlignenumNotopVertical text alignment.
wrapboolNofalseEnables text wrapping.
letterSpacingnumberNo0Additional spacing between letters.
lineHeightnumberNoUnsetLine height override.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
minWidthnumberNoUnsetMinimum width.
minHeightnumberNoUnsetMinimum height.
maxWidthnumberNoUnsetMaximum width.
maxHeightnumberNoUnsetMaximum height.
xnumberNo0Local X position when applicable.
ynumberNo0Local Y position when applicable.
positionvec2Novec2(0, 0)Local position.
horizontalAlignenumNoInheritedComponent horizontal alignment.
verticalAlignenumNoInheritedComponent vertical alignment.
opacitynumberNo1Render opacity.
layerintegerNoContext defaultLayer order inside layered parents.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

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

Full syntax example

nui
Text StatusLabel {
    text: "Ready"
    font: "BodyFont"
    fontSize: 18
    color: "#F4F7FB"
    textAlign: center
    verticalTextAlign: center
    wrap: true
    letterSpacing: 1
    lineHeight: 22
    width: 220
    height: 36
    minWidth: 120
    minHeight: 24
    maxWidth: 360
    maxHeight: 80
    position: vec2(12, 8)
    horizontalAlign: center
    verticalAlign: center
    opacity: 0.9
    layer: 2
    visible: true
}

Limitations

  • Use Text for plain text only.
  • Rich text, decorators, inline images, and multiline editing are planned separately.