Expo UI and Router for iOSExpo SDK 57 and later, iOS only
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

You can add lineLimit to any view. It changes what you see on 34 of the 39 components.

No visible effect

These components accept it, but you see no change.

ComponentWhy nothing happens
SpacerIt changes only text, and Spacer shows no text.
DividerIt changes only text, and Divider shows no text.
SliderIt changes only text, and Slider shows no text.
ImageIt changes only text, and Image shows no text.
AccessoryWidgetBackgroundIt changes only text, and AccessoryWidgetBackground shows no text.

Sources

The original Expo docs for this page:

On this page