Composable Component

Text

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

@Preview(showBackground = true)
@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)
}