<!--
{
  "availability" : [
    "iOS: 27.2.0 -",
    "iPadOS: 27.2.0 -",
    "macCatalyst: 27.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/toolbarTitleAlignment(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE21toolbarTitleAlignmentyQrAA07ToolbareF0VF"
  },
  "title" : "toolbarTitleAlignment(_:)"
}
-->

# toolbarTitleAlignment(_:)

Sets the preferred alignment of the navigation bar’s title.

```
nonisolated func toolbarTitleAlignment(_ alignment: ToolbarTitleAlignment) -> some View
```

## Parameters

`alignment`

The preferred navigation title alignment.

## Discussion

The navigation bar resolves the alignment of its title automatically
based on context, and toolbar roles. Use this modifier to override that
resolution.

```
NavigationStack {
    ContentView()
        .navigationTitle("Library")
        .toolbarTitleAlignment(.center)
}
```

---

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)