<!--
{
  "availability" : [
    "iOS: 27.2.0 -",
    "iPadOS: 27.2.0 -",
    "macCatalyst: 27.2.0 -",
    "macOS: 27.2.0 -",
    "tvOS: 27.2.0 -",
    "visionOS: 27.2.0 -",
    "watchOS: 27.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/EnvironmentValues/toolbarTitleAlignment",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17EnvironmentValuesVAAE21toolbarTitleAlignmentAA07ToolbarfG0Vvp"
  },
  "title" : "toolbarTitleAlignment"
}
-->

# toolbarTitleAlignment

The alignment the navigation bar resolved for its title.

```
var toolbarTitleAlignment: ToolbarTitleAlignment { get set }
```

## Discussion

Read this from a custom title view (like a `ToolbarItem` using the
[`title`](/documentation/SwiftUI/ToolbarItemPlacement/title) placement) to lay out its content to
match the alignment the system chose.

When the system has resolved an alignment for the title, this reports
that concrete alignment, [`leading`](/documentation/SwiftUI/ToolbarTitleAlignment/leading) or
[`center`](/documentation/SwiftUI/ToolbarTitleAlignment/center), even when you have not set a
preference with [`toolbarTitleAlignment(_:)`](/documentation/SwiftUI/View/toolbarTitleAlignment(_:)). Otherwise it is
[`automatic`](/documentation/SwiftUI/ToolbarTitleAlignment/automatic).

```
struct AlbumTitle: View {
    @Environment(\.toolbarTitleAlignment) private var alignment

    var body: some View {
        VStack(alignment: alignment == .leading ? .leading : .center) {
            Text("Library")
            Text("42 Albums").font(.caption)
        }
    }
}
```

Use this to align content within the size your view already reported,
not to decide that size.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)