navigationSubtitle

Configures the view's subtitle for purposes of navigation, using a localized string resource.

View ModifieriOS 26.0+macCatalyst 16.0+macOS 13.0+navigationSubtitle(_:) in SwiftUI

Declaration

React
compose().navigationSubtitle(subtitleKey: string)
Swift
@export(implementation) nonisolated func navigationSubtitle(
    _ subtitleKey: LocalizedStringResource
) -> some View
3 more Swift overloads share this form
Swift
nonisolated func navigationSubtitle(
    _ subtitleKey: LocalizedStringKey
) -> some View
Swift
nonisolated func navigationSubtitle(_ subtitle: Text) -> some View
Swift
nonisolated func navigationSubtitle<S>(
    _ subtitle: S
) -> some View
where S : StringProtocol

Parameters

  • subtitleKey*string

    The key to a localized string to display.

Discussion

A view's navigation subtitle is used to provide additional contextual information alongside the navigation title. On macOS, the primary destination's subtitle is displayed with the navigation title in the titlebar. On iOS and iPadOS, the subtitle is displayed with the navigation title in the navigation bar.

See also

More in Navigation.