Skip to main content

ImageRadio

The ImageRadio widget renders a radio group as images, so you pick only one of several image options.
Only one item in a group stays selected, and each item shows a different image for its selected, unselected, and disabled states.

Definition and role

ImageRadio items that share the same groupId form a single radio group. Each item has its own value, and tapping an item sets the group's selected value to that item's value. The widget shows one of up to four images based on the combination of selected and enabled state, and selecting an item runs whatever you connected to onChanged.

  • Category: Contents
  • Single selection per group — only one item among those sharing a groupId
  • A separate image per state (selected + enabled / unselected + enabled / unselected + disabled / selected + disabled)

Features

FeatureDescription
Single selection per groupItems with the same groupId form one group, and only one of them stays selected. Tapping an item sets the group's selected value to that item's value.
Image per stateDepending on the selected and enabled combination, the widget shows one of activeAssetPath, inactiveAssetPath, disabledAssetPath, or disabledActiveAssetPath.
Label displayShow a text label (label) next to the image, and set its gap (labelGap) and text style (labelStyle).
Size settingsSet the displayed image size with radioWidth and radioHeight.
Selection eventWhen an item is selected, the logic or script connected to onChanged runs.

How to use

  1. Open the Contents category in the left widget palette.
  2. Drag and drop the ImageRadio item onto the canvas.
  3. Give the items you want to group together the same groupId.
  4. Give each item a distinct value and its per-state images (activeAssetPath, inactiveAssetPath, and so on).
  5. If needed, connect an action to onChanged to run when the item is selected.

Properties

note

radioWidth, radioHeight, label, labelStyle, and labelGap have no default value, so they take effect only once you set them.

PropertyDescriptionDefaultValue / type
groupIdRadio group identifier. Items with the same value act as one groupEmpty stringString
valueThis item's unique value. When the item is selected, the group's selected value becomes this valueEmpty stringString
groupValueThe group's current selected valueEmpty stringString
enableWhether the item is enabled. When off, the item can't be selected and shows its disabled imageOn (true)true / false
activeAssetPathImage path shown in the selected + enabled stateEmpty stringImage path (String)
inactiveAssetPathImage path shown in the unselected + enabled stateEmpty stringImage path (String)
disabledAssetPathImage path shown in the unselected + disabled stateEmpty stringImage path (String)
disabledActiveAssetPathImage path shown in the selected + disabled stateEmpty stringImage path (String)
radioWidthDisplayed image widthNot setNumber (px)
radioHeightDisplayed image heightNot setNumber (px)
labelText label shown next to the image (optional)Not setString
labelStyleText style for the label, such as color and sizeNot setText style
labelGapGap between the image and the labelNot setNumber (px)

Notes and tips

note

To act as one group, items must share the same groupId, and each item's value must differ. Tapping an item sets the group's selected value to its own value, which automatically deselects every other item in that group.

tip

If you don't set the per-state images, a fallback image appears — an empty image placeholder. Without radioWidth and radioHeight, that fallback renders at 20×20, and if you turn on label without setting labelGap, the gap between the image and the label is 8.

Learn more

tip

For the full set of Widget Control members (Property, Method, Event) you can script on this widget, visit ImageRadio Widget Control.