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

# multilineTextAlignment

An environment value that indicates how a text view aligns its lines
when the content wraps or contains newlines.

```
var multilineTextAlignment: TextAlignment { get set }
```

## Discussion

Set this value for a view hierarchy by applying the
[`multilineTextAlignment(_:)`](/documentation/SwiftUI/View/multilineTextAlignment(_:)) view modifier. Views in the
hierarchy that display text, like [`Text`](/documentation/SwiftUI/Text) or [`TextEditor`](/documentation/SwiftUI/TextEditor), read the
value from the environment and adjust their text alignment accordingly.

This value has no effect on a [`Text`](/documentation/SwiftUI/Text) view that contains only one
line of text, because a text view has a width that exactly matches the
width of its widest line. If you want to align an entire text view
rather than its contents, set the aligment of its container, like a
[`VStack`](/documentation/SwiftUI/VStack) or a frame that you create with the
[`frame(minWidth:idealWidth:maxWidth:minHeight:idealHeight:maxHeight:alignment:)`](/documentation/SwiftUI/View/frame(minWidth:idealWidth:maxWidth:minHeight:idealHeight:maxHeight:alignment:))
modifier.

> Note: You can use this value to control the alignment of a ``doc://com.apple.SwiftUI/documentation/SwiftUI/Text``
> view that you create with the ``doc://com.apple.SwiftUI/documentation/SwiftUI/Text/init(_:style:)`` initializer
> to display localized dates and times, including when the view uses
> only a single line, but only when that view appears in a widget.

---

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)