CNTabBarSearchItem class

Configuration for a search tab in CNTabBar.

When provided to CNTabBar.searchItem, this creates a dedicated search tab that follows iOS 26's native behavior:

  • Appears as a separate floating circular button on the right
  • Expands into a full search bar when tapped
  • Collapses other tabs to icon-only mode during search

Example:

CNTabBar(
  items: [...],
  searchItem: CNTabBarSearchItem(
    placeholder: 'Find customer',
    onSearchChanged: (query) => filterResults(query),
    onSearchSubmit: (query) => executeSearch(query),
    style: CNTabBarSearchStyle(
      iconSize: 22,
      activeIconColor: Colors.blue,
      searchBarPadding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
    ),
  ),
)
Annotations

Constructors

CNTabBarSearchItem({CNSymbol? icon, CNSymbol? activeIcon, String label = 'Search', String placeholder = 'Search', ValueChanged<String>? onSearchChanged, ValueChanged<String>? onSearchSubmit, ValueChanged<bool>? onSearchActiveChanged, bool automaticallyActivatesSearch = true, CNTabBarSearchStyle style = const CNTabBarSearchStyle()})
Creates a search tab configuration.
const

Properties

activeIcon → CNSymbol?
The icon to display when search is active.
final
automaticallyActivatesSearch → bool
Whether tapping the search tab automatically activates the search field.
final
hashCode → int
The hash code for this object.
no setteroverride
icon → CNSymbol?
The icon to display in the search tab button (collapsed state).
final
label → String
Label shown under the search icon button.
final
onSearchActiveChanged → ValueChanged<bool>?
Called when the search bar expands or collapses.
final
onSearchChanged → ValueChanged<String>?
Called when the search text changes.
final
onSearchSubmit → ValueChanged<String>?
Called when the user submits the search (presses enter/search).
final
placeholder → String
Placeholder text shown in the search bar when empty.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style → CNTabBarSearchStyle
Visual styling options for the search tab.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override