Label
A read-only text display. Shows static text or synced dynamic text. Stores a .string value when synced.
Type
"label"
Relevant Fields
Inherits all Control Definition. Key fields:
| Field | Type | Default | Description |
|---|---|---|---|
text |
string | — | Static display text (overridden by sync) |
label |
string | — | Alternative to text |
icon |
string | — | SF Symbol before text |
style |
string | "default" |
See Label Styles |
tint |
string | white | Text and icon color |
align |
string | "leading" |
"leading", "center", "trailing" |
formatValue |
string | — | Value display format (see formatValue table below) |
Format Values
| Value | Output | Example |
|---|---|---|
"decimal" |
"72" or "3.5" |
Rounds to integer |
"decimal:N" |
"3.14" |
Fixed N decimal places (e.g., "decimal:2") |
"percent" |
"80%" |
Integer percentage |
"time" |
"3:45" |
Minutes:seconds from total seconds |
"duration" |
"1h 23m" |
Human-readable duration from seconds |
"bytes" |
"1.2 GB" |
Auto-scaled byte units |
"bps" |
"54 Mbps" |
Auto-scaled bits-per-second |
"suffix:X" |
"72°F" |
Append custom suffix (e.g., "suffix:°F") |
"none" |
(hidden) | No value display |
Styles
| Value | Font |
|---|---|
"default" |
.subheadline |
"headline" |
.headline.bold |
"title" |
.title2.bold |
"caption" |
.caption |
"mono" |
.subheadline monospaced |
"large-mono" |
.title3 monospaced medium |
Examples
Static info label
{
"type": "label",
"id": "temp-display",
"position": [0, 0],
"span": [1, 2],
"text": "Current: 72°F"
}
Synced label with icon
{
"type": "label",
"id": "track-artist",
"position": [1, 2],
"span": [1, 2],
"text": "—",
"icon": "person.fill",
"tint": "#AAAAAA",
"sync": [{ "method": "meshsocket", "type": "listen", "event": "broadcast", "filter": { "msg_type": "player_state" }, "valuePath": "artist" }]
}
Headline style
{
"type": "label",
"id": "track-title",
"position": [0, 2],
"span": [1, 2],
"text": "No Track",
"style": "headline",
"sync": [{ "method": "meshsocket", "type": "listen", "event": "broadcast", "filter": { "msg_type": "player_state" }, "valuePath": "title" }]
}
Behavior
- When synced, the
textfield serves as a placeholder until the first sync value arrives - Text updates animate with a smooth numeric content transition
- Labels have no action — they are display-only
Related
- Control Definition — Base fields
- Label Styles — Style variants
- Sync — Live value updates