DataApp.radio_group(options: Optional[List[Union[int, float, str]]] = None, title: Optional[str] = None, label_by: Optional[str] = None, value_by: Optional[str] = None, value: Optional[List[Union[int, float, str, any]]] = None, style: Optional[typing_extensions.Literal[radio, button]] = None, **additional: object) RadioGroupWidget#

Creates a radio button group for displaying multiple choices and allows to select one value out of a set.

options :list, optional

A list of items to be chosen.

titlestr, optional

String with the RadioGroup title. It will be placed on top of the RadioGroup.

label_bystr, optional

Selects key to use as label.

value_bystr, optional

Selects key to use as value.

valueint, float or str, optional

Default value.

style“radio” or “button” , optional

Radio Group style.



>>> radiogroup1 = app.radio_group([1, 2, 3], value=2)
>>> # Radio group with dict values, index_by, label_by and value_by property
>>> radiogroup2 = app.radio_group(
>>>     [{"id": 1, "label": "world", "value": "bar"}, 
>>>     {"id": 2, "label": "moon", "value": "baz"}],
>>>     label_by="label",
>>>     value_by="value")

Bind compatibility

You can bind this widget with this:

Bindable as

You can bind this widget as:

  • str

  • int

  • float