Composable Function

RemoteText

Creates a text component that displays text.

RemoteText

Source set: JvmAndAndroid
@Composable
public fun RemoteText(
    text: RemoteString,
    modifier: RemoteModifier = RemoteModifier,
    color: RemoteColor? = null,
    fontSize: RemoteTextUnit? = null,
    fontStyle: RemoteFontStyle? = null,
    fontWeight: RemoteFontWeight? = null,
    fontFamily: RemoteFontFamily? = null,
    textAlign: RemoteTextAlign? = null,
    overflow: RemoteTextOverflow = RemoteTextOverflow.Clip,
    @IntRange(from = 1) maxLines: Int = Int.MAX_VALUE,
    fontFeatureSettings: String? = null,
    fontVariationSettings: RemoteFontVariation.Settings? = null,
    style: RemoteTextStyle = RemoteTextStyle.Default,
)

Creates a text component that displays text.

Note that density-dependent values like fontSize, RemoteTextStyle.letterSpacing, and RemoteTextStyle.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.

Basic text display with custom color and font size:

Styling text with bold weight and italic font style:

Using standard font families and variable font settings:

Parameters

text text to be displayed
modifier RemoteModifier to be applied to this text
color RemoteColor to apply to the text. If color is not specified and not provided in style, then opaque black (0xFF000000) is used.
fontSize size of the font
fontStyle font style to be applied to the text
fontWeight font weight to be applied to the text
fontFamily font family to be applied to the text
textAlign alignment of the text within its container
overflow how visual overflow should be handled
maxLines optional maximum number of lines for the text
fontFeatureSettings advanced typography settings provided by font in CSS format (e.g. "smcp" or "tnum")
fontVariationSettings font variation settings to be applied to the text
style RemoteTextStyle to be applied to the text
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: