TabBar
Represents a component containing a tab bar.
Properties:
tabs
: A list ofTabBarTile
instances representing individual tabs.bar_type
: The type of the tab bar, default isTabBarType.SWIPE
.
TabBarType
Enumerates the types of tab bars available.
Enum Values:
SWIPE
: Represents a swipeable tab bar.SEGMENTED
: Represents a segmented tab bar.BUTTON
: Represents a button-based tab bar.
TabBarTile
Represents a tile in a tab bar.
Properties:
title
: The title or icon of the tab.callback_data
(Optional): Callback data associated with the tab.selected
: Indicates whether the tab is selected (True
) or not (False
).
Usage Example:
tab_tile = TabBarTile(
title="Tab Title",
callback_data="tab_callback_data",
selected=True
)
Usage Example:
tab_bar = TabBar(
tabs=[tab_tile1, tab_tile2, tab_tile3],
bar_type=TabBarType.SWIPE
)