Composable Function

RemoteText

Remote composable that displays text.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

RemoteText

Android
@Composable
@RemoteComposable
public fun RemoteText(
    text: RemoteString,
    modifier: RemoteModifier = RemoteModifier,
    color: RemoteColor? = null,
    fontSize: RemoteTextUnit? = null,
    fontStyle: FontStyle? = null,
    fontWeight: FontWeight? = null,
    fontFamily: FontFamily? = null,
    textAlign: TextAlign? = null,
    overflow: TextOverflow = TextOverflow.Clip,
    maxLines: Int = Int.MAX_VALUE,
    style: RemoteTextStyle = RemoteTextStyle.Default,
    fontVariationSettings: FontVariation.Settings? = null,
)

Remote composable that displays text.

Note that density-dependent values like fontSize, [style#letterSpacing], and [style#lineHeight] are converted to pixels using RemoteDensity from the environment where the RemoteText is being created, not the remote environment where it will be displayed. This means these values are fixed at creation time based on the local density.

Parameters

text The text to be displayed.
modifier The RemoteModifier to be applied to this text.
color RemoteColor to apply to the text. If color is not specified, and it is not provided in style, then Color.Black will be used.
fontSize The size of the font.
fontStyle The font style to be applied to the text.
fontWeight The font weight to be applied to the text.
fontFamily The font family to be applied to the text.
textAlign The alignment of the text within its container.
overflow How visual overflow should be handled.
maxLines An optional maximum number of lines for the text.
style The RemoteTextStyle to be applied to the text.
fontVariationSettings The font variation settings to be applied to the text.