Skip to main content
Search Messages lets users locate specific messages across conversations and groups using keyword search, then navigate directly to the result. Before starting, complete the Getting Started guide for your framework.

Components


Integration Steps

1. Search State Management

Track the current search keyword and the message ID to scroll to. When a new search is triggered, reset goToMessageId so the list doesn’t jump to a stale result. File: CometChatHome.tsx

2. Search Input

Render the search component and wire its onSearch callback to update the keyword state. The placeholder text is localized. File: CometChatHome.tsx

3. Search Result Integration

Pass searchKeyword and goToMessageId to CometChatMessageList. The list filters messages matching the keyword and highlights them. When goToMessageId is set, the list scrolls to that message. File: CometChatHome.tsx

4. Navigate to Search Result

When a user taps a search result, set goToMessageId to that message’s ID. The message list will scroll to and highlight the target message. File: CometChatHome.tsx
Attach handleResultClick to your message search result selection logic.

Feature Matrix


Next Steps

Search

The search component reference.

Message List

Render real-time message threads.

All Guides

Browse all feature and formatter guides.

Sample App

Full working sample application on GitHub.