<!--
{
  "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/View/truncationMode(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE14truncationModeyQrAA4TextV010TruncationE0OF"
  },
  "title" : "truncationMode(_:)"
}
-->

# truncationMode(_:)

Sets the truncation mode for lines of text that are too long to fit in
the available space.

```
nonisolated func truncationMode(_ mode: Text.TruncationMode) -> some View
```

## Parameters

`mode`

The truncation mode that specifies where to truncate
the text within the text view, if needed. You can truncate at the
beginning, middle, or end of the text view.

## Return Value

A view that truncates text at different points in a line
depending on the mode you select.

## Discussion

Use the `truncationMode(_:)` modifier to determine whether text in a
long line is truncated at the beginning, middle, or end. Truncation is
indicated by adding an ellipsis (…) to the line when removing text to
indicate to readers that text is missing.

In the example below, the bounds of text view constrains the amount of
text that the view displays and the `truncationMode(_:)` specifies from
which direction and where to display the truncation indicator:

```
Text("This is a block of text that will show up in a text element as multiple lines. The text will fill the available space, and then, eventually, be truncated.")
    .frame(width: 150, height: 150)
    .truncationMode(.tail)
```

![A screenshot showing the effect of truncation mode on text in a](images/com.apple.SwiftUI/SwiftUI-view-truncationMode@2x.png)

---

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)