Tabbar

TabBar

The TabBar Widget enables the creation of tab bars, providing a convenient and visually appealing way to navigate between different sections or views within your application.

Test in Kitchen Sink (opens in a new tab)

Properties

PropertyTypeDescription
stylesobjectSee properties
selectedIndexintegerSelecting a Tab based on its index order
itemsarrayDefine each of your Tab here
onTabSelectionactionThe action that will be performed when a tab is pressed.
onTabSelectionHapticenumThe type of haptic to perform when a tab is pressed. It should be one of heavyImpact, mediumImpact, lightImpact, selectionClick, and vibrate

styles

PropertyTypeDescription
tabPositionstringHow to lay out the Tab labels
tabAlignmentenumThe TabBar alignments: start, startOffset, fill, center.
tabPaddingstring or integerPadding for each tab labels with CSS-style value. Default: 0 30 0 0 (right padding only)
tabFontSizeintegerFont size for the tab text
tabFontWeightstringFont weight for the tab text
tabBackgroundColorinteger or stringThe background color of the tab's navigation bar, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
activeTabColorinteger or stringThe color of the selected tab's text, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
inactiveTabColorinteger or stringThe color of the un-selected tabs' text, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
indicatorColorinteger or stringThe color of the selected tab's indicator, which can be represented in different formats. It can be specified as a number, a predefined color name, or a hexadecimal value starting with '0x'. transparent black blue white red grey teal amber pink purple yellow green brown cyan indigo lime orange
indicatorThicknessintegerThe thickness of the selected tab's indicator
marginstring or integerMargin with CSS-style notation e.g. margin: 5 20 5