TextVariantPreference

A protocol for controlling the size variant of text views.

ProtocoliOS 18.0+macOS 15.0+tvOS 18.0+watchOS 11.0+visionOS 2.0+TextVariantPreference in SwiftUI

Declaration

React
type TextVariantPreference =
  | 'fixed'
  | 'sizeDependent'
  | FixedTextVariant
  | SizeDependentTextVariant;
Swift
protocol TextVariantPreference

Pass a literal, or build one with SwiftUI.TextVariantPreference from import { SwiftUI } from 'swiftui-react-native'.

Type properties

  • The default text variant preference. It always chooses the largest available variant.

  • 'sizeDependent'SwiftUI.TextVariantPreference.sizeDependent

    The size dependent preference allows the text to take the available space into account when choosing the size variant to display.

Used by