This is beta documentation for Stream Chat Android SDK v7. For the latest stable version, see the latest version (v6) .

Custom Message Link Style

In this cookbook recipe, you'll learn how to customize how links appear in chat messages. This allows you to match your app's branding or improve link visibility for your users.

Links in chat messages are automatically detected and styled by the SDK. You might want to customize link styles to:

  • Match your app's color scheme and branding
  • Improve accessibility with more visible colors

The link color is controlled by the chatTextLink property in StreamDesign.Colors, which derives from accentPrimary:

Default Message Link Style

To customize the link color, override accentPrimary when creating your StreamDesign.Colors instance:

@Composable
private fun CustomMessageLinkStyle() {
    ChatTheme(
        colors = StreamDesign.Colors.default().copy(accentPrimary = Color.Red),
    ) {
        // Your chat UI - links will appear in red
        val factory = MessagesViewModelFactory(LocalContext.current, channelId = "messaging:general")
        MessagesScreen(viewModelFactory = factory)
    }
}

Both chatTextLink and chatTextMention are derived properties — chatTextLink defaults to accentPrimary, and chatTextMention defaults to chatTextLink. Changing accentPrimary will affect all accent-colored elements including links and @mentions.