RadioGroupFieldV1

toloka.client.project.template_builder.fields.RadioGroupFieldV1 | Source code

RadioGroupFieldV1(
self,
data: Optional[BaseComponent] = None,
options: Optional[Union[BaseComponent, List[Union[BaseComponent, GroupFieldOption]]]] = None,
*,
disabled: Optional[Union[BaseComponent, bool]] = None,
hint: Optional[Any] = None,
label: Optional[Any] = None,
validation: Optional[BaseComponent] = None,
version: Optional[str] = '1.0.0'
)

A component for selecting one value out of several options. It is designed as a group of circles arranged vertically.

If you want it to look like normal buttons, use field.button-radio-group.

The minimum number of buttons is one. Any type of data can be returned.

Parameters Description

ParametersTypeDescription
dataOptional[BaseComponent]

Data with values that will be processed or changed.

optionsOptional[Union[BaseComponent, List[Union[BaseComponent, GroupFieldOption]]]]

List of options to choose from

disabledOptional[Union[BaseComponent, bool]]

This property prevents clicking the button. If the value is True, the button is not active (the Toloker will not be able to click it).

hintOptional[Any]

Hint text.

labelOptional[Any]

Label above the component.

validationOptional[BaseComponent]

Validation based on condition.

Examples:

How to add label selector to interface.

radio_group_field = tb.fields.RadioGroupFieldV1(
tb.data.OutputData(path='result'),
[
tb.fields.GroupFieldOption('Cat', 'cat'),
tb.fields.GroupFieldOption('Dog', 'dog'),
],
validation=tb.conditions.RequiredConditionV1()
)
Toloka-Kit
OverviewGetting OAuth tokenQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming