# lv_tabview.h (/api/widgets/tabview/lv_tabview_h)



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

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

Functions [#functions]

<ApiTabs items="[&#x22;Setters (5)&#x22;,&#x22;Getters (6)&#x22;,&#x22;Other (2)&#x22;]">
  <ApiTab value="Setters (5)">
    <ApiMember kind="function" name="lv_tabview_set_tab_text" file="widgets/tabview/lv_tabview.h" line="61" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L61">
      lv_tabview_set_tab_text [#lv_tabview_set_tab_text]

      Change the name of the tab

      ```c title=" " lineNumbers=1
      void lv_tabview_set_tab_text(lv_obj_t *obj, uint32_t idx, const char *new_name)
      ```

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

      | Name       | Type                                             | Description                    |
      | ---------- | ------------------------------------------------ | ------------------------------ |
      | `obj`      | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a tabview widget    |
      | `idx`      | <ApiLink name="uint32_t" />                      | the index of the tab to rename |
      | `new_name` | `const char *`                                   | the new name as a string       |
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_set_tab_translation_tag" file="widgets/tabview/lv_tabview.h" line="71" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L71">
      lv_tabview_set_tab_translation_tag [#lv_tabview_set_tab_translation_tag]

      Add a tab with a translation tag to the tabview.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_tabview_set_tab_translation_tag(lv_obj_t *obj, const char *tag)
      ```

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

      | Name  | Type                                             | Description                                                              |
      | ----- | ------------------------------------------------ | ------------------------------------------------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a tabview widget                                              |
      | `tag` | `const char *`                                   | translation key used for the tab label; will be displayed on the tab bar |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the widget where the content of the tab can be created
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_set_active" file="widgets/tabview/lv_tabview.h" line="81" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L81">
      lv_tabview_set_active [#lv_tabview_set_active]

      Show a tab

      ```c title=" " lineNumbers=1
      void lv_tabview_set_active(lv_obj_t *obj, uint32_t idx, lv_anim_enable_t anim_en)
      ```

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

      | Name      | Type                                             | Description                  |
      | --------- | ------------------------------------------------ | ---------------------------- |
      | `obj`     | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a tabview widget  |
      | `idx`     | <ApiLink name="uint32_t" />                      | the index of the tab to show |
      | `anim_en` | <ApiLink name="lv_anim_enable_t" />              | LV\_ANIM\_ON/OFF             |
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_set_tab_bar_position" file="widgets/tabview/lv_tabview.h" line="88" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L88">
      lv_tabview_set_tab_bar_position [#lv_tabview_set_tab_bar_position]

      Set the position of the tab bar

      ```c title=" " lineNumbers=1
      void lv_tabview_set_tab_bar_position(lv_obj_t *obj, lv_dir_t dir)
      ```

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

      | Name  | Type                                             | Description                    |
      | ----- | ------------------------------------------------ | ------------------------------ |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a tabview widget    |
      | `dir` | <ApiLink name="lv_dir_t" />                      | LV\_DIR\_TOP/BOTTOM/LEFT/RIGHT |
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_set_tab_bar_size" file="widgets/tabview/lv_tabview.h" line="96" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L96">
      lv_tabview_set_tab_bar_size [#lv_tabview_set_tab_bar_size]

      Set the width or height of the tab bar

      ```c title=" " lineNumbers=1
      void lv_tabview_set_tab_bar_size(lv_obj_t *obj, int32_t size)
      ```

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

      | Name   | Type                                             | Description                                                                                                        |
      | ------ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to tabview widget                                                                                          |
      | `size` | <ApiLink name="int32_t" />                       | size of the tab bar in pixels or percentage. will be used as width or height based on the position of the tab bar) |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (6)">
    <ApiMember kind="function" name="lv_tabview_get_tab_count" file="widgets/tabview/lv_tabview.h" line="103" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L103">
      lv_tabview_get_tab_count [#lv_tabview_get_tab_count]

      Get the number of tabs

      ```c title=" " lineNumbers=1
      uint32_t lv_tabview_get_tab_count(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 tabview widget |

      **Returns:** <ApiLink name="uint32_t" /> — the number of tabs
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_get_tab_active" file="widgets/tabview/lv_tabview.h" line="110" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L110">
      lv_tabview_get_tab_active [#lv_tabview_get_tab_active]

      Get the current tab's index

      ```c title=" " lineNumbers=1
      uint32_t lv_tabview_get_tab_active(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 tabview widget |

      **Returns:** <ApiLink name="uint32_t" /> — the zero based index of the current tab
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_get_tab_button" file="widgets/tabview/lv_tabview.h" line="119" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L119">
      lv_tabview_get_tab_button [#lv_tabview_get_tab_button]

      Get a given tab button by index

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_tabview_get_tab_button(lv_obj_t *obj, int32_t idx)
      ```

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

      | Name  | Type                                             | Description                                                                                                               |
      | ----- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
      | `obj` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a tabview widget                                                                                               |
      | `idx` | <ApiLink name="int32_t" />                       | zero based index of the tab button to get. \< 0 means start counting tab button from the back (-1 is the last tab button) |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the tab button, or NULL if the index was out of range
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_get_content" file="widgets/tabview/lv_tabview.h" line="126" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L126">
      lv_tabview_get_content [#lv_tabview_get_content]

      Get the widget where the container of each tab is created

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_tabview_get_content(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 tabview widget |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the main container widget
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_get_tab_bar" file="widgets/tabview/lv_tabview.h" line="133" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L133">
      lv_tabview_get_tab_bar [#lv_tabview_get_tab_bar]

      Get the tab bar where the buttons are created

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_tabview_get_tab_bar(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 tabview widget |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the tab bar
    </ApiMember>

    <ApiMember kind="function" name="lv_tabview_get_tab_bar_position" file="widgets/tabview/lv_tabview.h" line="140" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L140">
      lv_tabview_get_tab_bar_position [#lv_tabview_get_tab_bar_position]

      Get the position of the tab bar

      ```c title=" " lineNumbers=1
      lv_dir_t lv_tabview_get_tab_bar_position(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 tabview widget |

      **Returns:** <ApiLink name="lv_dir_t" /> — LV\_DIR\_TOP/BOTTOM/LEFT/RIGHT
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (2)">
    <ApiMember kind="function" name="lv_tabview_create" file="widgets/tabview/lv_tabview.h" line="45" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L45">
      lv_tabview_create [#lv_tabview_create]

      Create a tabview widget

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_tabview_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 |

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

    <ApiMember kind="function" name="lv_tabview_add_tab" file="widgets/tabview/lv_tabview.h" line="53" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L53">
      lv_tabview_add_tab [#lv_tabview_add_tab]

      Add a tab to the tabview

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_tabview_add_tab(lv_obj_t *obj, const char *name)
      ```

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

      | Name   | Type                                             | Description                                              |
      | ------ | ------------------------------------------------ | -------------------------------------------------------- |
      | `obj`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a tabview widget                              |
      | `name` | `const char *`                                   | the name of the tab, it will be displayed on the tab bar |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — the widget where the content of the tab can be created
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="_lv_property_tabview_id_t" file="widgets/tabview/lv_tabview.h" line="29" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L29">
  \_lv_property_tabview_id_t [#_lv_property_tabview_id_t]

  | Name                                   | Value                                                            |
  | -------------------------------------- | ---------------------------------------------------------------- |
  | `LV_PROPERTY_TABVIEW_TAB_ACTIVE`       | `(LV_PROPERTY_TABVIEW_START + ((int) 0 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_TABVIEW_TAB_BAR_POSITION` | `(LV_PROPERTY_TABVIEW_START + ((int) 1 )) \| ((  1   ) <<  28 )` |
  | `LV_PROPERTY_TABVIEW_END`              |                                                                  |
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_tabview_class" file="widgets/tabview/lv_tabview.h" line="26" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/widgets/tabview/lv_tabview.h#L26">
  lv_tabview_class [#lv_tabview_class]

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

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_obj.h&#x22;, &#x22;lv_obj_property.h&#x22;]" includedBy="[&#x22;lv_tabview_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.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_conf_kconfig.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_property_names.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_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
