Highlight Search Keyword in Message Bubbles within CometChatMessageList
The CometChatMessageList component filters messages using setSearchKeyword, but the keyword is not highlighted within the message bubbles. It would be helpful to highlight the search keyword within the message content, similar to the “find” feature, improving the user experience by making it easier to locate specific content.
Log in to comment and vote
Comments1
Hi there! Thanks for the suggestion.
Great news - this is already supported! Our Search component highlights matching keywords within message bubbles out of the box.
You can check it out here:
📖 Component docs: https://www.cometchat.com/docs/ui-kit/react/search
💻 Sample implementation: https://github.com/cometchat/cometchat-uikit-react/blob/v6/sampleapp/src/components/CometChatMessages/CometChatMessages.tsx#L51
The sample app shows how to wire up search with keyword highlighting in CometChatMessages. If you need any help with the implementation, feel free to reach out!