Number Input
Prompt operator with numeric input.
You can create a number input with number_input:
ui:
components:
- key: voltage
type: number_input
label: "Voltage"
placeholder: "3.3"
description: "Enter the measured voltage"
required: trueProperties
Display
You can configure how the input field appears to the operator.
| Property | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Unique identifier for accessing the value |
type | string | Yes | Must be "number_input" |
label | string | No | Display label for the input |
description | string | No | Helper text displayed below the input |
placeholder | string | No | Hint text shown when empty |
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 input field |
bind | string | No | Bind to unit property or measurement. See Collect Input for details. |
Modifiers
You can configure numeric increment behavior.
| Property | Type | Required | Description |
|---|---|---|---|
step | number | No | Increment step for +/- buttons (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) |
min | number | No | Minimum allowed value |
max | number | No | Maximum allowed value |
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
Range Validation
We'll enforce minimum and maximum value limits:
phases:
- name: Measure Voltage
ui:
components:
- key: voltage
type: number_input
label: "Voltage"
min: 3.0
max: 3.6
required: trueDecimal Precision
We'll configure decimal places and step increment:
phases:
- name: Collect Temperature
ui:
components:
- key: temperature
type: number_input
label: "Temperature"
placeholder: "25.0"
step: 0.1
required: trueHow is this guide?