Examples
- Basic Usage
- With Icons
- Expanded Layout

A simple tab bar with text-only tabs.
Properties
Required
A list of tabs to display in the tab bar. Each tab must have a unique
id
.The ID of the currently active tab. Must match one of the tab IDs in the
tabs
list.Callback function called when a tab is selected. Receives the ID of the selected tab.
Content
Custom spacing between tabs. If not provided, uses theme default spacing.
Layout
Whether the tab bar should expand to fill the available width. When true, tabs are distributed evenly. When false, tabs wrap naturally.
Tab Properties
TheNeoTab
class represents individual tabs within the tab bar:
Required
A unique identifier for the tab. This is used to track the active tab and is passed to the
onChange
callback.The text label displayed on the tab.
Content
An optional icon to display alongside the label.
Best Practices
- Width Constraints: When using
isExpanded: true
, always provide width constraints to prevent layout issues by wrapping inExpanded
,ConstrainedBox
,SizedBox
, etc. - Combine with
NeoHaptics
in theonChanged
callback for enhanced user experience on supported devices. - Always ensure tab IDs are unique within a single
NeoTabBar
to prevent errors.