Composable Function

RemoteText

Creates a text component that displays text.

RemoteTextSample

@Sampled
@Preview
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteTextSample() {
    RemoteText(text = "Hello Remote Compose".rs, color = Color.Blue.rc, fontSize = 20.rsp)
}

RemoteTextStylingSample

@Sampled
@Preview
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteTextStylingSample() {
    RemoteText(
        text = "Bold & Italic".rs,
        fontWeight = RemoteFontWeight.Bold,
        fontStyle = RemoteFontStyle.Italic,
    )
}

RemoteTextFontFamilySample

@Sampled
@Preview
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
@Composable
fun RemoteTextFontFamilySample() {
    RemoteColumn {
        RemoteText(text = "Serif".rs, fontFamily = RemoteFontFamily.Serif)
        RemoteText(text = "Sans Serif".rs, fontFamily = RemoteFontFamily.SansSerif)
        RemoteText(text = "Monospace".rs, fontFamily = RemoteFontFamily.Monospace)
        RemoteText(text = "ExtraBold".rs, fontWeight = RemoteFontWeight.ExtraBold)
        RemoteText(
            text = "Named Flex Font with Variations".rs,
            fontFamily = RemoteFontFamily.Named("device:roboto-flex"),
            fontVariationSettings =
                RemoteFontVariation.Settings(
                    RemoteFontVariation.weight(300.rf),
                    RemoteFontVariation.width(70f.rf),
                ),
        )
    }
}
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: