Compose Component

Text

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

@Sampled
@Composable
fun TextWithLinks() {
    val url = "https://developer.android.com/jetpack/compose"
    val annotatedString = buildAnnotatedString {
        append("Build better apps faster with ")
        // If the annotation's TextLinkStyles is null,
        // then the link style defaults to Material styling.
        withLink(LinkAnnotation.Url(url = url)) { append("Jetpack Compose") }
    }
    Text(annotatedString)
}
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: