TofuPilotTofuPilot

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: true

Properties

Display

You can configure how the input field appears to the operator.

PropertyTypeRequiredDescription
keystringYesUnique identifier for accessing the value
typestringYesMust be "number_input"
labelstringNoDisplay label for the input
descriptionstringNoHelper text displayed below the input
placeholderstringNoHint text shown when empty

Value

You can set default values and bind to measurements or unit properties.

PropertyTypeRequiredDescription
default_valuenumberNoDefault value to pre-fill the input field
bindstringNoBind to unit property or measurement. See Collect Input for details.

Modifiers

You can configure numeric increment behavior.

PropertyTypeRequiredDescription
stepnumberNoIncrement step for +/- buttons (default: 1)

Validation

You can validate input range before the value is submitted.

PropertyTypeRequiredDescription
requiredbooleanNoIf true, operator must provide input (shows "Required" badge)
minnumberNoMinimum allowed value
maxnumberNoMaximum 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: true

Decimal 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: true

How is this guide?