# lv_span.h (/api/public/widgets/lv_span_h)



<RelatedHeaders name="lv_span_private.h" isPrivate="false" />

<ApiSummary functions="33" enums="3" structs="1" typedefs="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (12)&#x22;,&#x22;Getters (14)&#x22;,&#x22;Other (7)&#x22;]">
  <ApiTab value="Setters (12)">
    <ApiMember kind="function" name="lv_span_set_text" file="public/widgets/lv_span.h" line="109" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L109">
      lv_span_set_text [#lv_span_set_text]

      Set a new text for a span. Memory will be allocated to store the text by the span. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore `lv_spangroup_refresh(spangroup)` needs to be called manually,

      ```c title=" " lineNumbers=1
      void lv_span_set_text(lv_span_t *span, const char *text)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description        |
      | ------ | -------------------------------------------------- | ------------------ |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span. |
      | `text` | `const char *`                                     | pointer to a text. |
    </ApiMember>

    <ApiMember kind="function" name="lv_span_set_text_fmt" file="public/widgets/lv_span.h" line="120" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L120">
      lv_span_set_text_fmt [#lv_span_set_text_fmt]

      Set a new text for a span using a printf-like formatting string. Memory will be allocated to store the text by the span. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore `lv_spangroup_refresh(spangroup)` needs to be called manually,

      ```c title=" " lineNumbers=1
      void lv_span_set_text_fmt(lv_span_t *span, const char *fmt,...)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description                 |
      | ------ | -------------------------------------------------- | --------------------------- |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.          |
      | `fmt`  | `const char *`                                     | `printf`-like format string |
      | `...`  |                                                    |                             |
    </ApiMember>

    <ApiMember kind="function" name="lv_span_set_text_static" file="public/widgets/lv_span.h" line="131" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L131">
      lv_span_set_text_static [#lv_span_set_text_static]

      Set a static text. It will not be saved by the span so the 'text' variable has to be 'alive' while the span exist. As the spangroup is not passed a redraw (invalidation) can't be triggered automatically. Therefore `lv_spangroup_refresh(spangroup)` needs to be called manually,

      ```c title=" " lineNumbers=1
      void lv_span_set_text_static(lv_span_t *span, const char *text)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description        |
      | ------ | -------------------------------------------------- | ------------------ |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span. |
      | `text` | `const char *`                                     | pointer to a text. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_text" file="public/widgets/lv_span.h" line="139" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L139">
      lv_spangroup_set_span_text [#lv_spangroup_set_span_text]

      Set a new text for a span. Memory will be allocated to store the text by the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_text(lv_obj_t *obj, lv_span_t *span, const char *text)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description                    |
      | ------ | -------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup widget. |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.             |
      | `text` | `const char *`                                     | pointer to a text.             |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_text_static" file="public/widgets/lv_span.h" line="147" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L147">
      lv_spangroup_set_span_text_static [#lv_spangroup_set_span_text_static]

      Set a new text for a span. Memory will be allocated to store the text by the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_text_static(lv_obj_t *obj, lv_span_t *span, const char *text)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description                    |
      | ------ | -------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup widget. |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.             |
      | `text` | `const char *`                                     | pointer to a text.             |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_text_fmt" file="public/widgets/lv_span.h" line="156" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L156">
      lv_spangroup_set_span_text_fmt [#lv_spangroup_set_span_text_fmt]

      Set a new text for a span using a printf-like formatting string. Memory will be allocated to store the text by the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_text_fmt(lv_obj_t *obj, lv_span_t *span, const char *fmt,...)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description                    |
      | ------ | -------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup widget. |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span.             |
      | `fmt`  | `const char *`                                     | `printf`-like format string    |
      | `...`  |                                                    |                                |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_span_style" file="public/widgets/lv_span.h" line="165" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L165">
      lv_spangroup_set_span_style [#lv_spangroup_set_span_style]

      Copy all style properties of style to the bbuilt-in static style of the span.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_span_style(lv_obj_t *obj, lv_span_t *span, const lv_style_t *style)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                       | Description                                               |
      | ------- | ---------------------------------------------------------- | --------------------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | pointer\_to a spangroup                                   |
      | `span`  | <ApiLink name="lv_span_t" display="lv_span_t *" />         | pointer to a span.                                        |
      | `style` | <ApiLink name="lv_style_t" display="const lv_style_t *" /> | pointer to a style to copy into the span's built-in style |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_align" file="public/widgets/lv_span.h" line="174" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L174">
      lv_spangroup_set_align [#lv_spangroup_set_align]

      DEPRECATED. Use the text\_align style property instead Set the align of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_align(lv_obj_t *obj, lv_text_align_t align)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                         |
      | ------- | ------------------------------------------------ | ----------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.      |
      | `align` | <ApiLink name="lv_text_align_t" />               | see lv\_text\_align\_t for details. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_overflow" file="public/widgets/lv_span.h" line="181" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L181">
      lv_spangroup_set_overflow [#lv_spangroup_set_overflow]

      Set the overflow of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_overflow(lv_obj_t *obj, lv_span_overflow_t overflow)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name       | Type                                             | Description                            |
      | ---------- | ------------------------------------------------ | -------------------------------------- |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.         |
      | `overflow` | <ApiLink name="lv_span_overflow_t" />            | see lv\_span\_overflow\_t for details. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_indent" file="public/widgets/lv_span.h" line="188" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L188">
      lv_spangroup_set_indent [#lv_spangroup_set_indent]

      Set the indent of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_indent(lv_obj_t *obj, int32_t indent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                    |
      | -------- | ------------------------------------------------ | ------------------------------ |
      | `obj`    | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
      | `indent` | `int32_t`                                        | the first line indentation     |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_mode" file="public/widgets/lv_span.h" line="197" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L197">
      lv_spangroup_set_mode [#lv_spangroup_set_mode]

      DEPRECATED, set the width to LV\_SIZE\_CONTENT or fixed value to control expanding/wrapping" Set the mode of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_mode(lv_obj_t *obj, lv_span_mode_t mode)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                        |
      | ------ | ------------------------------------------------ | ---------------------------------- |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.     |
      | `mode` | <ApiLink name="lv_span_mode_t" />                | see lv\_span\_mode\_t for details. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_set_max_lines" file="public/widgets/lv_span.h" line="204" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L204">
      lv_spangroup_set_max_lines [#lv_spangroup_set_max_lines]

      Set maximum lines of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_set_max_lines(lv_obj_t *obj, int32_t lines)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                                                                         |
      | ------- | ------------------------------------------------ | ----------------------------------------------------------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.                                                      |
      | `lines` | `int32_t`                                        | max lines that can be displayed in LV\_SPAN\_MODE\_BREAK mode. \< 0 means no limit. |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (14)">
    <ApiMember kind="function" name="lv_span_get_style" file="public/widgets/lv_span.h" line="216" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L216">
      lv_span_get_style [#lv_span_get_style]

      Get a pointer to the style of a span's built-in style. Any lv\_style\_set\_... functions can be applied on the returned style.

      ```c title=" " lineNumbers=1
      lv_style_t * lv_span_get_style(lv_span_t *span)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description         |
      | ------ | -------------------------------------------------- | ------------------- |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to the span |

      **Returns:** <ApiLink name="lv_style_t" display="lv_style_t *" /> — pointer to the style. (valid as long as the span is valid)
    </ApiMember>

    <ApiMember kind="function" name="lv_span_get_text" file="public/widgets/lv_span.h" line="223" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L223">
      lv_span_get_text [#lv_span_get_text]

      Get a pointer to the text of a span

      ```c title=" " lineNumbers=1
      const char * lv_span_get_text(lv_span_t *span)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description         |
      | ------ | -------------------------------------------------- | ------------------- |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to the span |

      **Returns:** `const char *` — pointer to the text
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_child" file="public/widgets/lv_span.h" line="237" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L237">
      lv_spangroup_get_child [#lv_spangroup_get_child]

      Get a spangroup child by its index.

      ```c title=" " lineNumbers=1
      lv_span_t * lv_spangroup_get_child(const lv_obj_t *obj, int32_t id)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                                                                                                                                             |
      | ----- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | The spangroup object                                                                                                                                    |
      | `id`  | `int32_t`                                              | the index of the child. 0: the oldest (firstly created) child 1: the second oldest child count-1: the youngest -1: the youngest -2: the second youngest |

      **Returns:** <ApiLink name="lv_span_t" display="lv_span_t *" /> — The child span at index `id`, or NULL if the ID does not exist
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_span_count" file="public/widgets/lv_span.h" line="244" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L244">
      lv_spangroup_get_span_count [#lv_spangroup_get_span_count]

      Get number of spans

      ```c title=" " lineNumbers=1
      uint32_t lv_spangroup_get_span_count(const lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                   | Description                                     |
      | ----- | ------------------------------------------------------ | ----------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="const lv_obj_t *" /> | the spangroup object to get the child count of. |

      **Returns:** `uint32_t` — the span count of the spangroup.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_align" file="public/widgets/lv_span.h" line="251" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L251">
      lv_spangroup_get_align [#lv_spangroup_get_align]

      Get the align of the spangroup.

      ```c title=" " lineNumbers=1
      lv_text_align_t lv_spangroup_get_align(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="lv_text_align_t" /> — the align value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_overflow" file="public/widgets/lv_span.h" line="258" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L258">
      lv_spangroup_get_overflow [#lv_spangroup_get_overflow]

      Get the overflow of the spangroup.

      ```c title=" " lineNumbers=1
      lv_span_overflow_t lv_spangroup_get_overflow(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="lv_span_overflow_t" /> — the overflow value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_indent" file="public/widgets/lv_span.h" line="265" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L265">
      lv_spangroup_get_indent [#lv_spangroup_get_indent]

      Get the indent of the spangroup.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_indent(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** `int32_t` — the indent value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_mode" file="public/widgets/lv_span.h" line="271" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L271">
      lv_spangroup_get_mode [#lv_spangroup_get_mode]

      Get the mode of the spangroup.

      ```c title=" " lineNumbers=1
      lv_span_mode_t lv_spangroup_get_mode(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_max_lines" file="public/widgets/lv_span.h" line="278" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L278">
      lv_spangroup_get_max_lines [#lv_spangroup_get_max_lines]

      Get maximum lines of the spangroup.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_max_lines(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** `int32_t` — the max lines value.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_max_line_height" file="public/widgets/lv_span.h" line="284" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L284">
      lv_spangroup_get_max_line_height [#lv_spangroup_get_max_line_height]

      Get max line height of all span in the spangroup.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_max_line_height(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_expand_width" file="public/widgets/lv_span.h" line="293" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L293">
      lv_spangroup_get_expand_width [#lv_spangroup_get_expand_width]

      Get the text content width when all span of spangroup on a line.

      ```c title=" " lineNumbers=1
      uint32_t lv_spangroup_get_expand_width(lv_obj_t *obj, uint32_t max_width)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type                                             | Description                                                                                                                       |
      | ----------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
      | `obj`       | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object.                                                                                                    |
      | `max_width` | `uint32_t`                                       | if text content width >= max\_width, return max\_width to reduce computation, if max\_width == 0, returns the text content width. |

      **Returns:** `uint32_t` — text content width or max\_width.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_expand_height" file="public/widgets/lv_span.h" line="301" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L301">
      lv_spangroup_get_expand_height [#lv_spangroup_get_expand_height]

      Get the text content height with width fixed.

      ```c title=" " lineNumbers=1
      int32_t lv_spangroup_get_expand_height(lv_obj_t *obj, int32_t width)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                             | Description                    |
      | ------- | ------------------------------------------------ | ------------------------------ |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
      | `width` | `int32_t`                                        | the width of the span group.   |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_span_coords" file="public/widgets/lv_span.h" line="326" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L326">
      lv_spangroup_get_span_coords [#lv_spangroup_get_span_coords]

      Get the span's coords in the spangroup.

      ```c title=" " lineNumbers=1
      lv_span_coords_t lv_spangroup_get_span_coords(lv_obj_t *obj, const lv_span_t *span)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                                     | Description                    |
      | ------ | -------------------------------------------------------- | ------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />         | pointer to a spangroup object. |
      | `span` | <ApiLink name="lv_span_t" display="const lv_span_t *" /> | pointer to a span.             |

      **Returns:** <ApiLink name="lv_span_coords_t" /> — the span's coords in the spangroup.

      <Callout type="info">
        Before calling this function, please make sure that the layout of span group has been updated. Like calling <ApiLink name="lv_obj_update_layout" display="lv_obj_update_layout()" /> like function.

        ```
        +--------+
        |Heading +--->------------------+
        |  Pos   |   |     Heading      |
        +--------+---+------------------+
        |                               |
        |                               |
        |                               |
        |            Middle   +--------+|
        |                     |Trailing||
        |                   +-|  Pos   ||
        |                   | +--------+|
        +-------------------v-----------+
        |     Trailing      |
        +-------------------+

        ```
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_get_span_by_point" file="public/widgets/lv_span.h" line="334" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L334">
      lv_spangroup_get_span_by_point [#lv_spangroup_get_span_by_point]

      Get the span object by point.

      ```c title=" " lineNumbers=1
      lv_span_t * lv_spangroup_get_span_by_point(lv_obj_t *obj, const lv_point_t *p)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                                       | Description                                      |
      | ----- | ---------------------------------------------------------- | ------------------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" />           | pointer to a spangroup object.                   |
      | `p`   | <ApiLink name="lv_point_t" display="const lv_point_t *" /> | pointer to point containing absolute coordinates |

      **Returns:** <ApiLink name="lv_span_t" display="lv_span_t *" /> — pointer to the span under the point or `NULL` if not found.
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (7)">
    <ApiMember kind="function" name="lv_span_stack_init" file="public/widgets/lv_span.h" line="70" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L70">
      lv_span_stack_init [#lv_span_stack_init]

      ```c title=" " lineNumbers=1
      void lv_span_stack_init(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_span_stack_deinit" file="public/widgets/lv_span.h" line="71" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L71">
      lv_span_stack_deinit [#lv_span_stack_deinit]

      ```c title=" " lineNumbers=1
      void lv_span_stack_deinit(void)
      ```
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_create" file="public/widgets/lv_span.h" line="79" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L79">
      lv_spangroup_create [#lv_spangroup_create]

      Create a spangroup object

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_spangroup_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                                                                         |
      | -------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a parent widget **May** be `NULL`.. When NULL, the widget is created as a screen on the default display. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created spangroup
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_add_span" file="public/widgets/lv_span.h" line="86" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L86">
      lv_spangroup_add_span [#lv_spangroup_add_span]

      Create a span string descriptor and add to spangroup.

      ```c title=" " lineNumbers=1
      lv_span_t * lv_spangroup_add_span(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |

      **Returns:** <ApiLink name="lv_span_t" display="lv_span_t *" /> — pointer to the created span.
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_delete_span" file="public/widgets/lv_span.h" line="96" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L96">
      lv_spangroup_delete_span [#lv_spangroup_delete_span]

      Remove the span from the spangroup and free memory.

      ```c title=" " lineNumbers=1
      void lv_spangroup_delete_span(lv_obj_t *obj, lv_span_t *span)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                               | Description                                                              |
      | ------ | -------------------------------------------------- | ------------------------------------------------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" />   | pointer to a spangroup object.                                           |
      | `span` | <ApiLink name="lv_span_t" display="lv_span_t *" /> | pointer to a span. **May** be `NULL`.. When NULL nothing will be deleted |

      <Callout type="info">
        Note that before calling `lv_spangroup_delete_span` `lv_observer_delete` needs to be called manually as LVGL can't remove the binding automatically.
      </Callout>
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_refresh" file="public/widgets/lv_span.h" line="344" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L344">
      lv_spangroup_refresh [#lv_spangroup_refresh]

      Update the mode of the spangroup.

      ```c title=" " lineNumbers=1
      void lv_spangroup_refresh(lv_obj_t *obj)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spangroup object. |
    </ApiMember>

    <ApiMember kind="function" name="lv_spangroup_bind_span_text" file="public/widgets/lv_span.h" line="359" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L359">
      lv_spangroup_bind_span_text [#lv_spangroup_bind_span_text]

      Bind an integer, string, or pointer Subject to a Spangroup's Span.

      ```c title=" " lineNumbers=1
      lv_observer_t * lv_spangroup_bind_span_text(lv_obj_t *obj, lv_span_t *span, lv_subject_t *subject, const char *fmt)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                                     | Description                                                                                                  |
      | --------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" />         | pointer to Spangroup                                                                                         |
      | `span`    | <ApiLink name="lv_span_t" display="lv_span_t *" />       | pointer to Span                                                                                              |
      | `subject` | <ApiLink name="lv_subject_t" display="lv_subject_t *" /> | pointer to Subject                                                                                           |
      | `fmt`     | `const char *`                                           | optional printf-like format string with 1 format specifier (e.g. "%d °C") **May** be `NULL`.. See note below |

      **Returns:** <ApiLink name="lv_observer_t" display="lv_observer_t *" /> — pointer to newly-created Observer

      <Callout type="info">
        If `fmt == NULL` strings and pointers (`\0` terminated string) will be shown as text as they are, integers as d, floats as %0.1f
      </Callout>
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_span_overflow_t" file="public/widgets/lv_span.h" line="33" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L33">
  lv_span_overflow_t [#lv_span_overflow_t]

  | Name                        | Description  |
  | --------------------------- | ------------ |
  | `LV_SPAN_OVERFLOW_CLIP`     |              |
  | `LV_SPAN_OVERFLOW_ELLIPSIS` |              |
  | `LV_SPAN_OVERFLOW_LAST`     | Fence member |
</ApiMember>

<TypeUsedBy name="lv_span_overflow_t" count="1">
  * `lv_spangroup_set_overflow` — param `overflow`
</TypeUsedBy>

<ApiMember kind="enum" name="lv_span_mode_t" file="public/widgets/lv_span.h" line="39" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L39">
  lv_span_mode_t [#lv_span_mode_t]

  | Name                  | Description                                            |
  | --------------------- | ------------------------------------------------------ |
  | `LV_SPAN_MODE_FIXED`  | fixed the obj size                                     |
  | `LV_SPAN_MODE_EXPAND` | Expand the object size to the text size                |
  | `LV_SPAN_MODE_BREAK`  | Keep width, break the too long lines and expand height |
  | `LV_SPAN_MODE_LAST`   | Fence member                                           |
</ApiMember>

<TypeUsedBy name="lv_span_mode_t" count="1">
  * `lv_spangroup_set_mode` — param `mode`
</TypeUsedBy>

<ApiMember kind="enum" name="_lv_property_span_id_t" file="public/widgets/lv_span.h" line="56" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L56">
  \_lv_property_span_id_t [#_lv_property_span_id_t]

  | Name                         | Value                                                         |
  | ---------------------------- | ------------------------------------------------------------- |
  | `LV_PROPERTY_SPAN_ALIGN`     | `(LV_PROPERTY_SPAN_START + ((int) 0 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_OVERFLOW`  | `(LV_PROPERTY_SPAN_START + ((int) 1 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_INDENT`    | `(LV_PROPERTY_SPAN_START + ((int) 2 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_MODE`      | `(LV_PROPERTY_SPAN_START + ((int) 3 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_MAX_LINES` | `(LV_PROPERTY_SPAN_START + ((int) 4 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPAN_END`       |                                                               |
</ApiMember>

Structs [#structs]

<ApiMember kind="struct" name="_lv_span_coords_t">
  \_lv_span_coords_t [#_lv_span_coords_t]

  Coords of a span

  | Member     | Type                         | Description |
  | ---------- | ---------------------------- | ----------- |
  | `heading`  | <ApiLink name="lv_area_t" /> |             |
  | `middle`   | <ApiLink name="lv_area_t" /> |             |
  | `trailing` | <ApiLink name="lv_area_t" /> |             |
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_span_coords_t" file="public/widgets/lv_span.h" line="51" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L51">
  lv_span_coords_t [#lv_span_coords_t]

  ```c title=" " lineNumbers=1
  typedef struct _lv_span_coords_t lv_span_coords_t
  ```

  Coords of a span
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_spangroup_class" file="public/widgets/lv_span.h" line="53" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_span.h#L53">
  lv_spangroup_class [#lv_spangroup_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_spangroup_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_obj.h&#x22;, &#x22;lv_observer.h&#x22;, &#x22;lv_obj_property.h&#x22;]" includedBy="[&#x22;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
