Detect when tab bar minimizes (.tabBarMinimizeBehavior)

Hi! I'm working on a iOS 26 SwiftUI prototype that adds an element to the content of a screen only when the tab bar is fully visible and not minimized (via .tabBarMinimizeBehavior).

Is there any way to detect when a tab bar is minimized? My hope is that I can use a ternary operator to display something only when a boolean is true.

Here's some code to illustrate my idea:

struct ContentView: View {
@State var isTabBarMinimized: Bool = false
var body: some View {
TabView {
Tab("View1", systemImage: "rainbow") {
// Only appears when tab bar is fully visible
Color.blue
.opacity(isTabBarMinimized? 0 : 1 )
}
Tab("View2", systemImage: "rainbow") {
View2()
}
Tab("View3", systemImage: "rainbow") {
View3()
}
Tab("View4", systemImage: "rainbow") {
View4()
}
}
.tabBarMinimizeBehavior(.onScrollDown)
}
}

You should be able to use a placement environment variable and use onChange to detect a change of the variable.

Place this in your ContentView

@Environment(\.tabViewBottomAccessoryPlacement) var placement

Then use onChange to detect the change between inline and expanded.

However, it seems that this environment property might be broken as of now. I have attempted to use it to create custom views for the minimized/inline accessory with no success.

Detect when tab bar minimizes (.tabBarMinimizeBehavior)
 
 
Q