Skip to content

Tabs

A navigation component that allows users to switch between different content areas within the same context. Tabs organize content into distinct sections, making it easy to access related information without navigating away from the current page.

The Tabs widget is a wrapper around Flutter’s TabBar that provides consistent styling and behavior aligned with the nucleus_ui design system. It automatically handles tab controller creation if none is provided.

  • Customizable: Supports various styling options for indicators, labels, and separators.
  • Flexible Layout: Can be scrollable or fixed-width depending on content needs.
  • Accessible: Built-in support for keyboard navigation and screen readers.

Simple text-based tabs with clean styling.


Tabs with icons positioned above the text labels.


Custom tabs with icons positioned below the text labels using custom layout.


PropertyTypeDescription
tabsList<Widget>The list of tabs to display. Required.
controllerTabController?Tab controller for managing tab state. Auto-created if null.
indicatorColorColor?Color of the line below the selected tab. Defaults to accent color.
labelColorColor?Color of the selected tab’s label. Defaults to accent color.
unselectedLabelColorColor?Color of unselected tab labels. Defaults to subtle foreground color.
indicatorSizeTabBarIndicatorSizeHow the indicator size is computed. Defaults to TabBarIndicatorSize.tab.
indicatorPaddingEdgeInsetsGeometryPadding around the tab indicator. Defaults to EdgeInsets.zero.
labelPaddingEdgeInsetsGeometryPadding around each tab’s label. Defaults to EdgeInsets.zero.
onTapValueChanged<int>?Callback when a tab is tapped. Receives the tapped tab’s index.
indicatorWeightdoubleThickness of the selected tab indicator line. Defaults to 1.0.
isScrollableboolWhether tabs can scroll horizontally. Defaults to false.
overlayColorWidgetStateProperty<Color?>?Color shown during tab interactions. Defaults to transparent.