---
title: "toolbarTitleAlignment(_:)"
framework: SwiftUI
role: symbol
role_heading: Instance Method
platforms: [iOS 27.2+, iPadOS 27.2+, Mac Catalyst 27.2+]
path: "swiftui/view/toolbartitlealignment(_:)"
---

# toolbarTitleAlignment(_:)

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

## Declaration

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

```

## Parameters

- `alignment`: The preferred navigation title alignment.

## Discussion

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) }
