Expo UI and Router for iOS
Modifiers

lineLimit

Sets the line limit for text in the view.

lineLimit()

Overload #1

Sets the line limit for text in the view.

Four variants matching SwiftUI:

  • lineLimit() — no line limit (unlimited lines)
  • lineLimit(5) — max 5 lines
  • lineLimit(5, { reservesSpace: true }) — max 5 lines, reserves height even when empty (iOS 16+, tvOS 16+)
  • lineLimit({ min: 3, max: 8 }) — range of 3 to 8 lines (iOS 16+, tvOS 16+)

Returns: ModifierConfig

See: Official SwiftUI documentation.

lineLimit(limit, options)

Overload #2

ParameterType
limitnumber
options(optional){ reservesSpace: boolean }

Sets the line limit for text in the view.

Four variants matching SwiftUI:

  • lineLimit() — no line limit (unlimited lines)
  • lineLimit(5) — max 5 lines
  • lineLimit(5, { reservesSpace: true }) — max 5 lines, reserves height even when empty (iOS 16+, tvOS 16+)
  • lineLimit({ min: 3, max: 8 }) — range of 3 to 8 lines (iOS 16+, tvOS 16+)

Returns: ModifierConfig

See: Official SwiftUI documentation.

lineLimit(range)

Overload #3

ParameterType
range{ max: number, min: number }

Sets the line limit for text in the view.

Four variants matching SwiftUI:

  • lineLimit() — no line limit (unlimited lines)
  • lineLimit(5) — max 5 lines
  • lineLimit(5, { reservesSpace: true }) — max 5 lines, reserves height even when empty (iOS 16+, tvOS 16+)
  • lineLimit({ min: 3, max: 8 }) — range of 3 to 8 lines (iOS 16+, tvOS 16+)

Returns: ModifierConfig

See: Official SwiftUI documentation.

Works with

This modifier works with any view. These components accept it:

Sources

The original Expo docs for this page:

On this page