Radio Group Card
Card type:
radioGroup
Data type of variable:
int

The radio group card displays a set of options as radio buttons, allowing users to select a single value. Selecting an option will update the value of the connected DataCards variable.
In addition to the common parameters and the input card parameters, the radioGroup card has the following configuration options:
Name | Type | Required | Description |
---|---|---|---|
options | list | Yes | List of option dicts in form [{'alias': 'A', 'value': 0}] . |
unit | str | No | Text to be displayed at the bottom of the card (only shown in horizontal orientation) |
orientation | str | No | Layout direction of the radio buttons. Options: 'vertical' (default) or 'horizontal' |
Examples
Basic radio group
options = [
{'alias': 'A', 'value': 0},
{'alias': 'B', 'value': 1},
{'alias': 'C', 'value': 2}
]
datacards.publish.card(
type='radioGroup',
orientation='vertical',
options=options,
label='RadioGroup',
unit='Unit',
variable_key='my_variable_key',
logic_view_size=(2, 2)
)

Horizontal radio group
datacards.publish.card(
type='radioGroup',
orientation='horizontal',
options=options,
label='RadioGroup',
unit='Unit',
variable_key='my_variable_key',
logic_view_size=(2, 1)
)

Last updated on