GlassTabBar.minimizable constructor

const GlassTabBar.minimizable({
  1. required List<GlassTab> tabs,
  2. required int selectedIndex,
  3. required ValueChanged<int> onTabSelected,
  4. Key? key,
  5. bool minimized = false,
  6. GlassTabBarMinimizeController? minimizeController,
  7. VoidCallback? onMinimizedTabTap,
  8. GlassTabBarTrailingButton? trailingButton,
  9. GlassTabBarExtraButton? extraButton,
  10. Widget? bottomAccessory,
  11. GlassTabBarAccessoryPlacement? bottomAccessoryPlacement,
  12. bool bottomAccessoryEnabled = true,
  13. double bottomAccessorySpacing = 6.0,
  14. double? bottomAccessoryHeight,
  15. double spacing = 8,
  16. double horizontalPadding = 20,
  17. double verticalPadding = 20,
  18. double barHeight = 64,
  19. double minimizedBarHeight = 50,
  20. double barBorderRadius = _kDefaultBottomBorderRadius,
  21. EdgeInsetsGeometry tabPadding = const EdgeInsets.symmetric(horizontal: 4),
  22. double iconLabelSpacing = 4,
  23. bool enableBlend = true,
  24. bool groupBackdrop = true,
  25. double blendAmount = 10,
  26. LiquidGlassSettings? settings,
  27. bool showIndicator = true,
  28. Color? indicatorColor,
  29. LiquidGlassSettings? indicatorSettings,
  30. double indicatorPinchStrength = 0.4,
  31. Color? selectedIconColor,
  32. Color? unselectedIconColor,
  33. Color? selectedLabelColor,
  34. Color? unselectedLabelColor,
  35. TextStyle? selectedLabelStyle,
  36. TextStyle? unselectedLabelStyle,
  37. double iconSize = 24,
  38. double labelFontSize = 11,
  39. TextStyle? textStyle,
  40. Duration glowDuration = const Duration(milliseconds: 300),
  41. double glowBlurRadius = 32,
  42. double glowSpreadRadius = 8,
  43. double glowOpacity = 0.6,
  44. GlassInteractionBehavior interactionBehavior = GlassInteractionBehavior.full,
  45. double? pressScale,
  46. Color? interactionGlowColor,
  47. double? interactionGlowRadius,
  48. GlassQuality? quality,
  49. GlassQuality? backgroundQuality,
  50. double magnification = 1.15,
  51. double innerBlur = 0.0,
  52. bool platformViewBackdrop = false,
  53. bool passthroughOverPlatformView = false,
  54. MaskingQuality maskingQuality = MaskingQuality.high,
  55. GlobalKey<State<StatefulWidget>>? backgroundKey,
  56. SpringDescription? springDescription,
  57. GlassTabPillAnchor tabPillAnchor = GlassTabPillAnchor.start,
  58. double? tabWidth,
  59. double? indicatorBorderRadius,
  60. EdgeInsetsGeometry indicatorExpansion = const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
  61. VoidCallback? onBarTap,
  62. bool whitenAtBottom = true,
  63. double whitenBottomThreshold = 45.0,
  64. double whitenAtBottomTarget = 1.0,
  65. ScrollController? scrollController,
  66. bool adaptiveBrightness = false,
  67. ValueChanged<Brightness>? onBrightnessChanged,
  68. ValueListenable<Brightness>? brightnessOverride,
})

Creates a bottom bar that minimizes to the selected tab's circle — SwiftUI's tabBarMinimizeBehavior, i.e. the GlassTabBar.searchable morph without the search.

Drives the same layout engine as the searchable placement, so the minimize is the identical spring morph, but the API speaks navigation rather than search: minimized replaces isSearchActive (the caller decides when — typically from scroll direction, matching .tabBarMinimizeBehavior(.onScrollDown)), tapping the minimized tab circle fires onMinimizedTabTap (the "bring my tabs back" control), and the slot the search pill occupies is an optional plain action button — trailingButton — or nothing at all. Both pills render at minimizedBarHeight while minimized, mirroring how the native minimized bar sits slightly smaller than the expanded one.

The trailing slot maps onto the native components:

  • trailingButton: null — a plain minimizing tab bar; the tabs get the full bar width, and the minimized state is the selected tab's circle alone.
  • With a trailingButton, the button is present in both states — exactly how a Tab(role: .search) trailing circle keeps its priority visibility through the minimize.

trailingButton may change between builds and the bar animates the difference: the button spring-scales in and out in place at its slot. An app that wants a button only while minimized simply passes it only while minimized is true — the appearing button grows in at the trailing edge as the tab pill shrinks to its circle.

Minimizing on scroll

Pass a GlassTabBarMinimizeController as minimizeController and the bar minimizes itself from the scroll view given to scrollController — the equivalent of .tabBarMinimizeBehavior(.onScrollDown). The controller then owns the state and minimized is ignored:

GlassTabBar.minimizable(
  tabs: tabs,
  selectedIndex: index,
  onTabSelected: onTabSelected,
  minimizeController: _minimize,
  scrollController: _scroll,
  onMinimizedTabTap: _minimize.expand,
)

A host that cannot reach the current screen's ScrollController leaves scrollController off and feeds the minimize controller from a NotificationListener instead — see GlassTabBarMinimizeController.handleNotification.

Without one, minimized stays a plain controlled prop and the caller decides when to flip it.

A bottomAccessory follows the bar: with no explicit bottomAccessoryPlacement it moves inline as the bar minimizes, the way iOS 26 animates a tabViewBottomAccessory down into the minimized bar. Pass GlassTabBarAccessoryPlacement.expanded to pin it.

Implementation

const GlassTabBar.minimizable({
  required List<GlassTab> tabs,
  required int selectedIndex,
  required ValueChanged<int> onTabSelected,
  Key? key,
  bool minimized = false,
  GlassTabBarMinimizeController? minimizeController,
  VoidCallback? onMinimizedTabTap,
  GlassTabBarTrailingButton? trailingButton,
  GlassTabBarExtraButton? extraButton,
  Widget? bottomAccessory,
  GlassTabBarAccessoryPlacement? bottomAccessoryPlacement,
  bool bottomAccessoryEnabled = true,
  double bottomAccessorySpacing = 6.0,
  double? bottomAccessoryHeight,
  double spacing = 8,
  double horizontalPadding = 20,
  double verticalPadding = 20,
  double barHeight = 64,
  double minimizedBarHeight = 50,
  double barBorderRadius = _kDefaultBottomBorderRadius,
  EdgeInsetsGeometry tabPadding = const EdgeInsets.symmetric(horizontal: 4),
  double iconLabelSpacing = 4,
  bool enableBlend = true,
  bool groupBackdrop = true,
  double blendAmount = 10,
  LiquidGlassSettings? settings,
  bool showIndicator = true,
  Color? indicatorColor,
  LiquidGlassSettings? indicatorSettings,
  double indicatorPinchStrength = 0.4,
  Color? selectedIconColor,
  Color? unselectedIconColor,
  Color? selectedLabelColor,
  Color? unselectedLabelColor,
  TextStyle? selectedLabelStyle,
  TextStyle? unselectedLabelStyle,
  double iconSize = 24,
  double labelFontSize = 11,
  TextStyle? textStyle,
  Duration glowDuration = const Duration(milliseconds: 300),
  double glowBlurRadius = 32,
  double glowSpreadRadius = 8,
  double glowOpacity = 0.6,
  GlassInteractionBehavior interactionBehavior =
      GlassInteractionBehavior.full,
  double? pressScale,
  Color? interactionGlowColor,
  double? interactionGlowRadius,
  GlassQuality? quality,
  GlassQuality? backgroundQuality,
  double magnification = 1.15,
  double innerBlur = 0.0,
  bool platformViewBackdrop = false,
  bool passthroughOverPlatformView = false,
  MaskingQuality maskingQuality = MaskingQuality.high,
  GlobalKey? backgroundKey,
  SpringDescription? springDescription,
  GlassTabPillAnchor tabPillAnchor = GlassTabPillAnchor.start,
  double? tabWidth,
  double? indicatorBorderRadius,
  EdgeInsetsGeometry indicatorExpansion =
      const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
  VoidCallback? onBarTap,
  bool whitenAtBottom = true,
  double whitenBottomThreshold = 45.0,
  double whitenAtBottomTarget = 1.0,
  ScrollController? scrollController,
  bool adaptiveBrightness = false,
  ValueChanged<Brightness>? onBrightnessChanged,
  ValueListenable<Brightness>? brightnessOverride,
}) : this._(
        key: key,
        placement: _GlassTabBarPlacement.minimizable,
        tabs: tabs,
        selectedIndex: selectedIndex,
        onTabSelected: onTabSelected,
        isSearchActive: minimized,
        onMinimizedTabTap: onMinimizedTabTap,
        trailingButton: trailingButton,
        extraButton: extraButton,
        minimizeController: minimizeController,
        bottomAccessoryPlacement: bottomAccessoryPlacement,
        bottomAccessory: bottomAccessory,
        bottomAccessoryEnabled: bottomAccessoryEnabled,
        bottomAccessorySpacing: bottomAccessorySpacing,
        bottomAccessoryHeight: bottomAccessoryHeight,
        spacing: spacing,
        horizontalPadding: horizontalPadding,
        verticalPadding: verticalPadding,
        barHeight: barHeight,
        searchBarHeight: minimizedBarHeight,
        barBorderRadius: barBorderRadius,
        tabPadding: tabPadding,
        iconLabelSpacing: iconLabelSpacing,
        enableBlend: enableBlend,
        groupBackdrop: groupBackdrop,
        blendAmount: blendAmount,
        settings: settings,
        showIndicator: showIndicator,
        indicatorColor: indicatorColor,
        indicatorSettings: indicatorSettings,
        indicatorPinchStrength: indicatorPinchStrength,
        selectedIconColor: selectedIconColor,
        unselectedIconColor: unselectedIconColor,
        selectedLabelColor: selectedLabelColor,
        unselectedLabelColor: unselectedLabelColor,
        selectedLabelStyle: selectedLabelStyle,
        unselectedLabelStyle: unselectedLabelStyle,
        iconSize: iconSize,
        labelFontSize: labelFontSize,
        textStyle: textStyle,
        glowDuration: glowDuration,
        glowBlurRadius: glowBlurRadius,
        glowSpreadRadius: glowSpreadRadius,
        glowOpacity: glowOpacity,
        interactionBehavior: interactionBehavior,
        pressScale: pressScale,
        interactionGlowColor: interactionGlowColor,
        interactionGlowRadius: interactionGlowRadius,
        quality: quality,
        backgroundQuality: backgroundQuality,
        magnification: magnification,
        innerBlur: innerBlur,
        platformViewBackdrop: platformViewBackdrop,
        passthroughOverPlatformView: passthroughOverPlatformView,
        maskingQuality: maskingQuality,
        backgroundKey: backgroundKey,
        springDescription: springDescription,
        tabPillAnchor: tabPillAnchor,
        tabWidth: tabWidth,
        indicatorBorderRadius: indicatorBorderRadius,
        indicatorExpansion: indicatorExpansion,
        onBarTap: onBarTap,
        whitenAtBottom: whitenAtBottom,
        whitenBottomThreshold: whitenBottomThreshold,
        whitenAtBottomTarget: whitenAtBottomTarget,
        scrollController: scrollController,
        adaptiveBrightness: adaptiveBrightness,
        onBrightnessChanged: onBrightnessChanged,
        brightnessOverride: brightnessOverride,
      );