Text
Display-only text that updates dynamically.
You can create a text display with text:
ui:
components:
- key: voltage_reading
type: text
label: "Voltage Reading"
value: "4.987 V"
size: xl
color: lime
font: monospaceProperties
Display
You can configure how the text appears to the operator.
| Property | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Unique identifier for updating the value |
type | string | Yes | Must be "text" |
label | string | No | Display label above the text |
description | string | No | Helper text displayed below the label |
value | string | No | Text content to display |
Styling
You can customize the text appearance with size, color, and font options.
| Property | Type | Required | Description |
|---|---|---|---|
size | string | No | Text size |
color | string | No | Text color |
font | string | No | Font family |
Sizes
| Size | Example |
|---|---|
xs | Extra small |
sm | Small |
base | Base (default) |
lg | Large |
xl | Extra large |
Colors
| Color | Example | Color | Example | Color | Example |
|---|---|---|---|---|---|
default | zinc | red | |||
orange | yellow | green | |||
lime | sky | blue | |||
violet | purple | pink |
Fonts
| Font | Example |
|---|---|
default | Standard sans-serif font |
monospace | Monospace font |
Examples
Voltage Measurement Display
We'll display voltage readings with styling for visibility:
phases:
- name: Voltage Test
python:
module: measure_voltage
ui:
components:
- key: voltage_reading
type: text
label: "Measured Voltage"
description: "Live reading from multimeter"
value: "0.00 V"
size: xl
color: lime
font: monospaceimport time
def measure_voltage(run, multimeter):
for _ in range(10):
voltage = multimeter.read_voltage()
run.ui.voltage_reading = f"{voltage:.2f} V"
time.sleep(0.5)Status Updates
We'll update status text as operations progress:
phases:
- name: Long Running Test
python:
module: show_status
ui:
components:
- key: status
type: text
label: "Status"
value: "Initializing..."
color: blueimport time
def show_status(run):
operations = [
"Powering on device",
"Running self-test",
"Calibrating sensors",
"Collecting data"
]
for operation in operations:
run.ui.status = operation
time.sleep(1)
run.ui.status = "Complete"Styled Test Results
We'll use different sizes and colors for visual hierarchy:
phases:
- name: Test Results
python:
module: show_results
ui:
components:
- key: title
type: text
value: "Test Results"
size: xl
color: blue
- key: result_status
type: text
value: "PASS"
size: lg
color: green
font: monospace
- key: details
type: text
value: "All measurements within spec"
size: sm
color: zincHow is this guide?