Slider
Prompt operator with visual slider control for numeric values.
You can create a slider with slider:
ui:
components:
- key: volume
type: slider
label: "Volume"
min: 0
max: 100
step: 5
description: "Adjust the test volume level"
required: trueProperties
Display
You can configure how the slider appears to the operator.
| Property | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Unique identifier for accessing the value |
type | string | Yes | Must be "slider" |
label | string | No | Display label for the slider |
description | string | No | Helper text displayed below the slider |
Value
You can set default values and bind to measurements or unit properties.
| Property | Type | Required | Description |
|---|---|---|---|
default_value | number | No | Default value to pre-fill the slider. If not set, slider starts in "Unset" state. |
bind | string | No | Bind to unit property or measurement. See Collect Input for details. |
Range
You must define the slider's valid range.
| Property | Type | Required | Description |
|---|---|---|---|
min | number | Yes | Minimum value |
max | number | Yes | Maximum value |
step | number | No | Increment step for slider movement (default: 1) |
Validation
You can validate input range before the value is submitted.
| Property | Type | Required | Description |
|---|---|---|---|
required | boolean | No | If true, operator must provide input (shows "Required" badge) |
TofuPilot validates operator input before submission, preventing continuation until all constraints are met.
Examples
Unset State
Sliders without a default value start in an "Unset" state:
phases:
- name: Adjust Setting
ui:
components:
- key: parameter
type: slider
label: "Optional Parameter"
min: 0
max: 100
# No default_value set - starts as "Unset" #
description: "Adjust if needed, or leave unset"Range Configuration
We'll configure the slider with specific min, max, and step values:
phases:
- name: Set Voltage
ui:
components:
- key: voltage
type: slider
label: "Test Voltage"
min: 3.0
max: 12.0
step: 0.1
required: trueHow is this guide?