navigationLinkIndicatorVisibility

Configures whether navigation links show a disclosure indicator.

View ModifieriOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+visionOS 1.0+navigationLinkIndicatorVisibility(_:) in SwiftUI

Declaration

React
compose().navigationLinkIndicatorVisibility(
  visibility: SwiftUI.Visibility
)
Swift
@MainActor @export(implementation) @preconcurrency func navigationLinkIndicatorVisibility(
    _ visibility: Visibility
) -> some View

Parameters

Discussion

If you need to detect whether the navigation disclosure indicator should be shown for the current view, read the EnvironmentValues.navigationLinkIndicatorVisibility environment value.

The following example hides the indicator for all links in the list. The indicator can be hidden for a specific link by placing the modifier on the NavigationLink itself.

struct NoIndicatorLink: View {
    var body: some View {
        NavigationStack {
            List {
                NavigationLink("See detail") {
                    Text("Detail view")
                }
            }
            .navigationLinkIndicatorVisibility(.hidden)
        }
    }
}

to .visible regardless of whether the link is within a list. On operating systems prior to iOS 26 and aligned releases, setting the link indicator visibility to .visible is only supported for navigation links contained in a List.

See also

More in Navigation.