NUI / Components / Common
Icon
Icon displays a compact icon resource.
Supported for registered icon resources.
Overview
Icon displays a compact icon resource.
When to use
- Compact status symbols.
- Toolbar affordances.
- Resource indicators.
- Command markers.
Children
Does not support children.
Basic syntax
Icon AlertIcon {
resource: WarningIcon
}Supported properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
resource | resource | Yes | None | Icon resource slot. |
tintColor | color | No | White | Tint applied to the icon. |
fit | enum | No | stretch | Icon fit mode. |
width | number | No | Auto | Desired width. |
height | number | No | Auto | Desired height. |
opacity | number | No | 1 | Render opacity. |
layer | integer | No | Context default | Layer order inside layered parents. |
visible | bool | No | true | Visibility flag. |
Contextual properties
Contextual property rules
Icon 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
Icon AlertIcon {
resource: WarningIcon
tintColor: "#FFD166"
fit: contain
width: 24
height: 24
opacity: 1
layer: 1
visible: true
}Limitations
- resource must refer to a valid project icon resource.