Skip to main content
.minimumScaleFactor(factor: number): Component
factor
number
required
The minimum scale factor, from 0 to 1. For example, 0.5 allows text to shrink to 50% of its original size before truncating.

Support

Usage

Auto-shrinking text

Text("This text will shrink to fit")
    .minimumScaleFactor(0.5)
    .lineLimit(1)

Fitting a title in a fixed frame

Text("A Very Long Title That Needs to Fit")
    .font("title")
    .minimumScaleFactor(0.7)
    .lineLimit(1)
    .frame({ maxWidth: 200 })

Notes

  • The system progressively reduces the font size down to minimumScaleFactor * originalSize before falling back to truncation.
  • A value of 1 (the default) means no shrinking is allowed.
  • Best used in combination with .lineLimit() to constrain the text to a fixed number of lines.

See Also