---
title: toolbarTitleAlignment
framework: SwiftUI
role: symbol
role_heading: Instance Property
platforms: [iOS 27.2+, iPadOS 27.2+, Mac Catalyst 27.2+, macOS 27.2+, tvOS 27.2+, visionOS 27.2+, watchOS 27.2+]
path: swiftui/environmentvalues/toolbartitlealignment
---

# toolbarTitleAlignment

The alignment the navigation bar resolved for its title.

## Declaration

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

## Discussion

Discussion Read this from a custom title view (like a ToolbarItem using the 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 or center, even when you have not set a preference with toolbarTitleAlignment(_:). Otherwise it is 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.
