Skip to main content

Icon

The Icon widget displays a single glyph from an icon font on screen.
Use it in menus, buttons, status indicators, and anywhere else you want to convey meaning visually.

Definition and role

The Icon widget draws one glyph from an icon font at the size and color you specify. Pick the glyph with a code point and a font family, then set its size, color, semantic label, and text direction.

  • Category: Contents
  • Default icon code point: 0xe000
  • Default placement size (Sized Box): 36 × 36 (px)

Features

FeatureDescription
Icon displayDraws a single glyph from an icon font on screen.
Size and colorSet the icon's size (size) and color (color).
Glyph selectionChoose the glyph to show (iconData) with a code point and a font family.
AccessibilitySet the semantic label for screen readers (semanticLabel) and the text direction (textDirection).

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag the Icon item onto the canvas.
  3. In the Properties panel on the right, choose the icon to display (iconData).
  4. Adjust the size (size) and color (color) as needed.

Properties

PropertyDescriptionDefaultValue / Type
iconDataIcon glyph to display (code point + font family)0xe000Icon setting
sizeIcon sizeNot setNumber (px)
colorIcon colorNot setColor
semanticLabelSemantic label read out by screen readersNot setString
textDirectionText direction the icon is drawn inNot setrtl, ltr

Notes and tips

tip

Leave size and color unset and the icon inherits its values from the parent widget or the theme. Set both properties explicitly when you need a specific size or color.

note

An icon glyph is identified by two values: a code point and a font family. Pass both together when you change the icon from a script.

Learn more

tip

For the full set of Widget Controls (Property, Method, and Event) that drive this widget from a script, visit Icon Widget Control.