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 = ChannelViewModelFactory(LocalContext.current, channelId = "messaging:general")
        ChannelScreen(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.

Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat Android v7: <Your Question>