Skip to main content

Radio / Checkbox

Displays radio buttons or checkboxes.

Tapping a radio button selects it and deselects others in the same group. Tapping a checkbox toggles its selection state.

KeyTypeDescriptionRequiredDefaultMin VersionNotes
optionsarray of dictOptions list*
numPerLineintegerItems per line2 on iPhone, 4 on iPad1.2-10Max 12
minCountintegerMinimum selected items0Checkbox only
maxCountintegerMaximum selected itemsINT_MAXCheckbox only

Each option dict has:

KeyTypeDescriptionCondition
titlestringOption titleLocalizable
valueprimitiveSaved value; defaults to title if omittedOptional

This component does not support label/icon/height. Use Group to add titles/descriptions.

Return TypeDescription
array of primitiveArray of selected option values

Theme

Theme KeyTypeDescription
tagTextColorColorTag text color
tagSelectedTextColorColorSelected tag text color
tagBackgroundColorColorTag background color
tagSelectedBackgroundColorColorSelected tag background color
tagBorderColorColorTag border color
tagSelectedBorderColorColorSelected tag border color

Example

{
cell = "Group";
label = "Checkbox Group";
footerText = "Tap to select; tap again to deselect; up to 4 items";
};
{
default = { "Red"; "Green"; };
cell = "Checkbox";
key = "checkbox";
maxCount = 4;
numPerLine = 4;
options = {
{ title = "Red"; };
{ title = "Green"; };
{ title = "Blue"; };
{ title = "Yellow"; };
"Purple";
"Black";
"White";
"Brown";
"Khaki";
"Gray";
};
};
{
cell = "Group";
label = "Radio Group";
footerText = "Tap to select";
};
{
default = "Fifth";
cell = "Radio";
key = "radio";
options = {
{ title = "First"; };
{ title = "Second"; };
{ title = "Third"; };
{ title = "Fourth"; };
{ title = "Fifth"; value = "Fifth"; };
"Last";
};
};

XUI-Radio.png

XUI-Checkbox.png