Composable Function

RemoteText

High level element that displays text and provides semantics / accessibility information.

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? = LocalTextConfiguration.current.textAlign,
    overflow: TextOverflow = LocalTextConfiguration.current.overflow,
    maxLines: Int = LocalTextConfiguration.current.maxLines,
    style: RemoteTextStyle = LocalRemoteTextStyle.current,
    fontVariationSettings: FontVariation.Settings? = null,
)

High level element that displays text and provides semantics / accessibility information.

For ease of use, commonly used parameters from androidx.compose.ui.text.TextStyle are also present here. The order of precedence is as follows:

  • If a parameter is explicitly set here (i.e, it is not null or androidx.compose.ui.unit.TextUnit.Unspecified), then this parameter will always be used.
  • If a parameter is not set, (null or androidx.compose.ui.unit.TextUnit.Unspecified), then the corresponding value from style will be used instead.

Parameters

text The text to be displayed.
modifier Modifier to apply to this layout node.
color Color to apply to the text.
fontSize The size of glyphs to use when painting the text. See androidx.compose.ui.text.TextStyle.fontSize.
fontStyle The typeface variant to use when drawing the letters (e.g., italic). See androidx.compose.ui.text.TextStyle.fontStyle.
fontWeight The typeface thickness to use when painting the text (e.g., FontWeight.Bold).
fontFamily The font family to be used when rendering the text. See androidx.compose.ui.text.TextStyle.fontFamily.
textAlign The alignment of the text within the lines of the paragraph. See androidx.compose.ui.text.TextStyle.textAlign.
overflow How visual overflow should be handled.
maxLines An optional maximum number of lines for the text to span.
style Style configuration for the text such as color, font, line height etc.
fontVariationSettings The font variation settings to be applied to the text.