Interactive previews iPhone Duo

Overlay Arrangement ZIndex

The z-index for a view within an overlay arrangement view.

Overlay Arrangement ZIndex - Preview Not Available

Platform Compatibility

iOS 27.1+ iPadOS 27.1+

Tags

SwiftUI Code

Docs
var body: some View {
    ArrangementView {
        // VStack required, otherwise zIndex is always 0
        VStack {
            SecondaryView()
        }
    } secondary: {
        Color.orange
    }
    .arrangementViewStyle(.overlay)
}

struct SecondaryView: View {
    @Environment(\.overlayArrangementZIndex) var zIndex

    var body: some View {
        Color.blue
            .frame(width: 210, height: 210)
            .opacity(zIndex == 0 ? 1.0 : 0)
    }
}

Found an issue or have a suggestion?

Created: September 28, 2026Updated: October 5, 2026
Connect Wizard

Connect Wizard

Unlock insights App Store Connect doesn’t show you.

Get Started