NUI / Components / Common

Image

ImplementedCommon / Media

Image displays an image resource in NUI.

Supported for registered image resources.

Overview

Image displays an image resource in NUI.

When to use

  • Portraits.
  • Item art.
  • Icons that need image resources.
  • Backgrounds.
  • Other texture-backed UI elements.

Children

Does not support children.

Basic syntax

nui
Image Portrait {
    resource: PlayerPortrait
}

Supported properties

PropertyTypeRequiredDefaultDescription
resourceresourceYesNoneImage resource slot.
tintColorcolorNoWhiteTint applied to the image.
fitenumNostretchImage fit mode.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
minWidthnumberNoUnsetMinimum width.
minHeightnumberNoUnsetMinimum height.
opacitynumberNo1Render opacity.
layerintegerNoContext defaultLayer order inside layered parents.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

Image 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
Image Portrait {
    resource: PlayerPortrait
    tintColor: "#FFFFFFFF"
    fit: contain
    width: 96
    height: 96
    minWidth: 48
    minHeight: 48
    opacity: 1
    layer: 1
    visible: true
}

Limitations

  • resource must refer to a valid project image resource.
  • Material-backed surfaces are planned separately.