Tab View (lv_tabview)

Organizes content into tabs with a configurable tab bar.

Overview

The Tab View organizes content into tabs with a tab bar. Each tab is a container you can fill with any widgets; the tab bar's position and size are configurable.

Learn more in the LVGL Open documentation.

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.

PartDescription
mainThe tab view body (the content container background): background and padding properties. The tab bar is a separate object styled via the tab_bar element, and each tab button (an lv_button) via the tab_button element.

Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.

PropertyTypeDescription
activeintSet active tab index (0-based)
active-animboolAnimate update (reference as active-anim) (default: false)
tab_bar_positionenum:lv_dirSet tab bar position (top, bottom, left, right)

<lv_tabview-tab_bar>

Get the tab bar object

access get · returns lv_obj

Parts

PartDescription
mainThe tab bar container holding the tab buttons: background and padding properties.
scrollbarThe tab bar's scrollbar shown when the buttons overflow: width (thickness), background properties and padding.

No attributes — created as an empty child.

<lv_tabview-tab>

Add a tab with content

access add · returns lv_obj

Parts

PartDescription
mainThe tab content page: background and padding properties.
scrollbarThe page's scrollbar shown when its content overflows: width (thickness), background properties and padding.
NameKindTypeDescription
textargstringSet tab button text

<lv_tabview-tab_button>

Get a specific tab button

access get · returns lv_obj

Parts

PartDescription
mainThe tab button (an lv_button): background, border and text properties. Use the 'checked' state for the active tab and 'pressed'/'focused' for feedback.
NameKindTypeDescription
indexargintTab index (0-based)

Last updated on

On this page