Hide or Replace Messages in a Chat Feed

Configure how each individual message in a chat feed is rendered in the Chat UI using custom logic and by extending the OverridableUI class.

Configure the renderMode function with your custom logic. This function is invoked per message to determine its UI representation, which can be hidden, default, or custom.

Using the sample code, set the EntryRenderMode enum value for each ChatFeedEntry of the ViewComponents interface.

  • To hide a chat message, have your renderMode function return EntryRenderMode.None for that specific entry.
  • To use the default built-in UI to display chat entries, set EntryRenderMode.Existing.
  • To use a customized UI to display chat entries using the composable CustomEntryContainer, set EntryRenderMode.Replace.

You must provide replacements for the entries that you replace. See the ​Sample Code for Defining Your Own UI for the Text Message Entry Type and Sample Code for Defining Your Own UI for the Choices message Entry Type​ sections for examples.