---
title: multilineTextAlignment
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/environmentvalues/multilinetextalignment
---

# multilineTextAlignment

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

## Declaration

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

## Discussion

Discussion Set this value for a view hierarchy by applying the multilineTextAlignment(_:) view modifier. Views in the hierarchy that display text, like Text or TextEditor, read the value from the environment and adjust their text alignment accordingly. This value has no effect on a 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 or a frame that you create with the frame(minWidth:idealWidth:maxWidth:minHeight:idealHeight:maxHeight:alignment:) modifier. note: You can use this value to control the alignment of a Text view that you create with the 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.

## See Also

### Formatting multiline text

- [lineSpacing(_:)](swiftui/view/linespacing(_:).md)
- [lineSpacing](swiftui/environmentvalues/linespacing.md)
- [multilineTextAlignment(_:)](swiftui/view/multilinetextalignment(_:).md)
