Radio
Prompt operator with single selection from mutually exclusive options.
You can create a radio component with radio:
ui:
components:
- key: voltage
type: radio
label: "Power Supply Voltage"
description: "Select the test voltage"
required: true
options:
- label: "3.3V"
value: "3.3"
- label: "5.0V"
value: "5.0"Properties
Display
You can configure how the radio component appears to the operator.
| Property | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Unique identifier for accessing the value |
type | string | Yes | Must be "radio" |
label | string | No | Display label for the radio component |
description | string | No | Helper text displayed below the radio component |
Value
You can set default values and bind to measurements or unit properties.
| Property | Type | Required | Description |
|---|---|---|---|
default_value | string | No | Default selected option value |
bind | string | No | Bind to unit property or measurement. See Collect Input for details. |
Options
You can define the list of mutually exclusive choices.
| Property | Type | Required | Description |
|---|---|---|---|
options | array | Yes | Array of objects with label and value properties |
Each option object has:
| Property | Type | Description |
|---|---|---|
label | string | Text displayed to the operator |
value | string | Value submitted when selected |
Validation
You can validate selection before the value is submitted.
| Property | Type | Required | Description |
|---|---|---|---|
required | boolean | No | If true, operator must select an option (shows "Required" badge) |
TofuPilot validates operator input before submission, preventing continuation until all constraints are met. For some workflows, this input validation can create workarounds where operators bypass the UI to proceed.
Instead, you can capture the input as a Measurement using Binding and validate it with Validators. TofuPilot will record the actual operator input while enforcing pass/fail criteria.
Examples
Test Mode Selection
We'll let the operator choose between different test modes:
phases:
- name: Configure Test
ui:
components:
- key: test_mode
type: radio
label: "Test Mode"
required: true
options:
- label: "Quick Test (30s)"
value: "quick"
- label: "Standard Test (2min)"
value: "standard"
- label: "Thorough Test (5min)"
value: "thorough"Quality Level
We'll collect quality assessment from the operator:
phases:
- name: Quality Assessment
ui:
components:
- key: quality_level
type: radio
label: "Quality Level"
description: "Assess the overall quality"
required: true
options:
- label: "Excellent"
value: "excellent"
- label: "Good"
value: "good"
- label: "Acceptable"
value: "acceptable"
- label: "Poor"
value: "poor"How is this guide?