Span Group (lv_spangroup)
Rich text built from spans, each with its own font, color and size.
Overview
The Span Group displays rich text built from multiple spans, each with its own text, font, color and size. Spans can be added or removed at runtime.
Learn more in the LVGL Open documentation.
Enumerations
lv_span_overflow — How to handle overflowing text
| Value | Description |
|---|---|
clip | Clip at boundary |
ellipsis | Replace overflowing words with ... |
Properties
Parts
Style parts of the widget with local style (e.g. style_bg_color-knob="0xff0000") or with style sheets (e.g. <style name="style_knob" selector="knob">). See Styles to learn more.
| Part | Description |
|---|---|
main | Style the text block and its background: text and background properties. Style individual spans via each span's own style. |
Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.
| Property | Type | Description |
|---|---|---|
overflow | enum:lv_span_overflow | Set overflow mode |
max_lines | int | Set max lines |
indent | int | Set first line indent (px) |
<lv_spangroup-span>
Add a styled text span
access add · returns lv_span
| Name | Kind | Type | Description |
|---|---|---|---|
text | prop | string | Set span text |
style | prop | style | Set span style |
bind_text | prop | subject | Bind text to a subject |
bind_text-fmt | prop | string | Format string (printf style) (default: NULL) |
Last updated on