# lv_spinner.h (/api/public/widgets/lv_spinner_h)



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

<ApiSummary functions="6" enums="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (3)&#x22;,&#x22;Getters (2)&#x22;,&#x22;Other (1)&#x22;]">
  <ApiTab value="Setters (3)">
    <ApiMember kind="function" name="lv_spinner_set_anim_params" file="public/widgets/lv_spinner.h" line="59" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_spinner.h#L59">
      lv_spinner_set_anim_params [#lv_spinner_set_anim_params]

      Set the animation time and arc length of the spinner The animation is suited for angle values between 180 and 360.

      ```c title=" " lineNumbers=1
      void lv_spinner_set_anim_params(lv_obj_t *obj, uint32_t t, uint32_t angle)
      ```

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

      | Name    | Type                                             | Description                        |
      | ------- | ------------------------------------------------ | ---------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner               |
      | `t`     | `uint32_t`                                       | the animation time in milliseconds |
      | `angle` | `uint32_t`                                       | the angle of the arc in degrees    |
    </ApiMember>

    <ApiMember kind="function" name="lv_spinner_set_anim_duration" file="public/widgets/lv_spinner.h" line="66" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_spinner.h#L66">
      lv_spinner_set_anim_duration [#lv_spinner_set_anim_duration]

      Set the animation time of the spinner

      ```c title=" " lineNumbers=1
      void lv_spinner_set_anim_duration(lv_obj_t *obj, uint32_t t)
      ```

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

      | Name  | Type                                             | Description                        |
      | ----- | ------------------------------------------------ | ---------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner               |
      | `t`   | `uint32_t`                                       | the animation time in milliseconds |
    </ApiMember>

    <ApiMember kind="function" name="lv_spinner_set_arc_sweep" file="public/widgets/lv_spinner.h" line="74" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_spinner.h#L74">
      lv_spinner_set_arc_sweep [#lv_spinner_set_arc_sweep]

      Set the animation arc length of the spinner. The animation is suited to values between 180 and 360.

      ```c title=" " lineNumbers=1
      void lv_spinner_set_arc_sweep(lv_obj_t *obj, uint32_t angle)
      ```

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

      | Name    | Type                                             | Description                     |
      | ------- | ------------------------------------------------ | ------------------------------- |
      | `obj`   | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a spinner            |
      | `angle` | `uint32_t`                                       | the angle of the arc in degrees |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_spinner_get_anim_duration" file="public/widgets/lv_spinner.h" line="81" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_spinner.h#L81">
      lv_spinner_get_anim_duration [#lv_spinner_get_anim_duration]

      Get the animation duration of the spinner

      ```c title=" " lineNumbers=1
      uint32_t lv_spinner_get_anim_duration(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 spinner |

      **Returns:** `uint32_t` — the animation time in milliseconds
    </ApiMember>

    <ApiMember kind="function" name="lv_spinner_get_arc_sweep" file="public/widgets/lv_spinner.h" line="88" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_spinner.h#L88">
      lv_spinner_get_arc_sweep [#lv_spinner_get_arc_sweep]

      Get the animation arc length of the spinner

      ```c title=" " lineNumbers=1
      uint32_t lv_spinner_get_arc_sweep(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 spinner |

      **Returns:** `uint32_t` — the angle of the arc in degrees
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (1)">
    <ApiMember kind="function" name="lv_spinner_create" file="public/widgets/lv_spinner.h" line="50" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_spinner.h#L50">
      lv_spinner_create [#lv_spinner_create]

      Create a spinner widget

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_spinner_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 *" /> — the created spinner
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

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

  | Name                                | Value                                                            |
  | ----------------------------------- | ---------------------------------------------------------------- |
  | `LV_PROPERTY_SPINNER_ANIM_DURATION` | `(LV_PROPERTY_SPINNER_START + ((int) 0 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPINNER_ARC_SWEEP`     | `(LV_PROPERTY_SPINNER_START + ((int) 1 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_SPINNER_END`           |                                                                  |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_spinner_class" file="public/widgets/lv_spinner.h" line="30" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_spinner.h#L30">
  lv_spinner_class [#lv_spinner_class]

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

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_types.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_draw_buf.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_palette.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;]" />
