Skip to main content
CometChatMentionsFormatter extends CometChatTextFormatter to format @mentions in text messages. It styles mention tokens, generates suggestion lists as users type, and handles click events on rendered mentions.

Usage

1. Initialize the formatter

2. Format a message

Provide the raw message string containing mention placeholders, then apply the formatter:
The output contains HTML with styled mentions ready for rendering.

3. Pass to components

Use the textFormatters prop on CometChatMessageList, CometChatMessageComposer, or CometChatConversations.

Next Steps

Custom Text Formatter

Build custom inline text patterns.

Message List

Render real-time message threads.

All Guides

Browse all feature and formatter guides.

Sample App

Full working sample application on GitHub.