Skip to main content
.lineLimit(lines?: number): Component
lines
number
The maximum number of lines to display. Excess text is truncated with an ellipsis. Pass undefined or omit to remove any line limit.

Support

Usage

Single-line text

Text("This is a very long piece of text that will be truncated")
    .lineLimit(1)

Two-line description

Text("A longer description that may wrap to a second line but will truncate after that with an ellipsis at the end.")
    .lineLimit(2)

Combined with minimum scale factor

Allow text to shrink before truncating.
Text("Shrink then truncate")
    .lineLimit(1)
    .minimumScaleFactor(0.5)

Notes

  • When text exceeds the line limit, it is truncated with an ellipsis (...) at the end.
  • Passing undefined or omitting the argument removes any previously set line limit, allowing unlimited lines.

See Also