Radio buttons let people select a single option from two or more choices.


valuestringkey value of the selected option.
labelstringDescriptive label for the choice group.
datastringAdditional data attached to the control. The value is passed in change event data along with a ChoiceGroup selected value.


changeFires when the choice has been changed.

Child controls#

Option control#

Option represents an item within ChoiceGroup.

keystringOption's key. text value will be used instead if key is not specified.
textstringOption's display text. key value will be used instead if text is not specified.
iconstringIcon name to display with this option.
iconColorstringIcon color.


Adding a new ChoiceGroup with a couple of options defined as tuples:

cg1 = page.add(ChoiceGroup(label="Favorite color:", options=[
("r", "Red"),
("g", "Green"),
("b", "Blue")

or as Option controls:

cg1 = page.add(ChoiceGroup(label="Favorite color:", options=[
Option("r", "Red"),
Option("g", "Green"),
Option("b", "Blue")

Get the key of selected option:

favorite_color = page.get_value(cg1)