Label

Text. Bind its Text to a variable and it becomes a readout; the binding's prefix, printf format and postfix are applied in bindings_apply().

Group: Basic · Default size: 100 × 24 · Style parts: Main

A dropped Label: the word Label in dark text in the middle of the screen.
A Label as it is dropped.
The Label settings section: Label mode Wrap, Text Label, Recolor and To be translated tick boxes.
Its settings.
SettingDefaultWhat it does
Label modeWrapWhat happens when the text is wider than the widget: Wrap, Dot (ellipsis), Scroll, Scroll circular or Clip.
TextLabelThe text. Multi-line is fine.
RecoloroffEnables #RRGGBB text# inline colouring. LVGL 8 only - use lv_span on 9.
To be translatedoffLists the text on the Languages tab, where it gets a translation for each language. Buttons, checkboxes, text areas and dropdowns have the same box. With one language it changes nothing in the generated code.

Example: a temperature readout

  1. Open the Data tab and, in Variables, press +. Name it temperature, set Type to Float, Initial value to 21.5 and Decimals to 1.
  2. Back on the Inspector tab, drag a Label onto the screen and set its Name to Temperature. Give it X 60, Y 100, Width 200, Height 40, and under Style settings > Text a font size of 28 px and Align Center.
  3. Open Data bindings and press Add binding. Leave it on From a variable, set Variable to temperature, Drives to Text, and Postfix to °C - a space, then the degree sign.
  4. Add a second label above it saying Indoor, centred the same way.
  5. Press Preview: the label says 21.5 °C. On the board it says whatever the variable holds, written again each time it changes.
Preview: the word Indoor above the reading 21.5 °C in large digits.
The readout in Preview.
The Data bindings section: From a variable, Variable temperature, Drives Text, Postfix °C.
The label’s text follows the variable.