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 Integration Guide.

Components


Implementation 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.

2. Search Input

Render the search bar component and wire its output to update the keyword state.

3. Search Result Integration

Pass searchKeyword and goToMessageId to cometchat-message-list. The list filters messages matching the keyword and highlights them. When goToMessageId is set, the list scrolls to that message.

4. Navigate to Search Result

When a user taps a search result, set goToMessageId to that message’s ID. The message list scrolls to and highlights the target message.

5. Complete Search Integration

A full component wiring search input, result display, and navigation together.

Feature Matrix


Next Steps

Search Bar

The search bar 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.