Skip to content

Presentation

Presentation hints let the backend suggest a visualization without specifying pixels.

Purpose

Backend says "this is a gauge", not "fontSize: 28, padding: 12". The runtime owns layout.

UI inference (automatic)

Property semanticsInferred component
numberMetric
number + min/maxGauge
number + historyTrend
boolean read-onlyStatus
boolean writableSwitch
enum writableSelect
stringText
locationMap

Presentation hints (explicit)

python
Number(view="slider")
Number(view="progress")
Boolean(view="alarm")
Enum(view="badge")
String(view="image" | "table" | "log")

All 16 supported views

CategoryViews
READmetric, gauge, trend, status, text, progress, alarm, badge, image, table, log, map
WRITEswitch, select, slider, input
ACTIONaction button (stateless — not a property view)

Rules

  • view overrides inference
  • Hints are preferences, not contracts — the UI may adapt
  • icon on Page/Action is a semantic token (chart, gauge, temperature), not a renderer icon name

Anti-pattern (what NOT to do)

json
{ "fontSize": 28, "padding": 12, "x": 100, "width": 240 }

This is pixel specification — forbidden. The runtime owns layout.

Also avoid renderer leakage: gap: 4px (use density: "compact") and icon: "bar-chart-outline" (use icon: "chart").

Common mistakes

  • Using view="gauge" on a property without min/max → gauge still works with defaults
  • Confusing view with user config — view is backend default, user can override locally
  • Sending pixel/icon-library values instead of semantic tokens

Built for self-hosted IoT runtimes.