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.
For more information, see field.radio-group.
Parameters | Type | Description |
---|---|---|
data | Optional[BaseComponent] | A data path. |
options | Optional[Union[BaseComponent, List[Union[BaseComponent, GroupFieldOption]]]] | A list of options. |
disabled | Optional[Union[BaseComponent, bool]] | Disabling the component:
Default value: |
hint | Optional[Any] | A hint. |
label | Optional[Any] | A label above the component. |
validation | Optional[BaseComponent] | Validation rules. |
Examples:
import toloka.client.project.template_builder as tbradio_group_field = tb.fields.RadioGroupFieldV1( data=tb.data.OutputData(path='result'), options=[ tb.fields.GroupFieldOption('Cat', 'cat'), tb.fields.GroupFieldOption('Dog', 'dog'), ], validation=tb.conditions.RequiredConditionV1())
Last updated: August 28, 2023