Mastering LinkAnnotation: The Modern Approach to Text Links | by Nav Singh | Apr, 2025
As per our use case, I decided to use the Url class because in our case, we have Text, which includes the HTTP URLs. @Composablefun LinkAnnotationExample() {Text(buildAnnotatedString {append(“Some other text “)withLink( LinkAnnotation.Url(// Added the sample Url here.url = “https://developer.android.com/jetpack/compose”,styles = TextLinkStyles(style = SpanStyle(color = Color.Blue),hoveredStyle = SpanStyle(color = Color.Red,textDecoration = TextDecoration.Underline),focusedStyle = SpanStyle(color = Color.Red,textDecoration … Read more