CometChatSearch
component is a powerful and customizable search interface that allows users to search across conversations and messages in real time. It supports a wide variety of filters, scopes, and customization options. CometChatSearch
helps users find messages, conversations, media, and more through an intuitive and filterable search experience. It can be embedded in multiple contexts — as part of the conversation list, message header, or as a full-screen search experience.
onConversationClicked
is triggered when you click on a Conversation from the search result. The onConversationClicked
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
onMessageClicked
is triggered when you click on a Message from the search result. The onMessageClicked
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
OnBack
is triggered when you click on the back button of the Message Header component. You can override this action using the following code snippet.
ConversationsRequestBuilder
in the Search Component to filter the search result. You can modify the builder as per your specific requirements with multiple options available to know more refer to ConversationRequestBuilder.
MessagesRequestBuilder
in the Search Component to filter the search result. You can modify the builder as per your specific requirements with multiple options available to know more refer to MessagesRequestBuilder.
Component
. By using event you can extend existing functionality. Being global events, they can be applied in multiple locations and are capable of being added or removed.
The CometChatSearch
component does not produce any events.
CometChatSearch
component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.
CometChatMessageHeader
Example
Property | Description | Code |
---|---|---|
User | A CometChat.User object representing the user in whose conversation the search will be performed. | user={chatUser} |
Group | A CometChat.Group object representing the group in whose conversation the search will be performed. | group={chatGroup} |
Hide Back Button | Hides the back button in the Search component. | hideBackButton={true} |
Hide User Status | Hides the user’s online/offline status indicator. | hideUserStatus={true} |
Hide Group Type | Hides the group type icon in conversation leading view. | hideGroupType={false} |
Hide Receipts | Disables the display of message read receipts in conversation result. | hideReceipts={false} |
Search Filters | List of filters to be rendered in the Search component. | searchFilters={[CometChatSearchFilter.Messages, CometChatSearchFilter.Photos, CometChatSearchFilter.Audio, CometChatSearchFilter.Documents]} |
Initial Search Filter | The filter which will be active by default on load. | initialSearchFilter={CometChatSearchFilter.Messages} |
Search In | List of entities in which the search should be performed. | searchIn={[CometChatSearchScope.Conversations]} |
Initial View | Custom view to be shown when CometChat Search is rendered & no search is performed. | initialView={<>Custom Initial View</>} |
Loading View | A custom component to display during the loading state. | loadingView={<>Custom Loading View</>} |
Empty View | A custom component to display when there are no conversations available. | emptyView={<>Custom Empty View</>} |
Error View | A custom component to display when an error occurs. | errorView={<>Custom Error View</>} |
CometChatConversations
component.
CometChatConversations
component.
CometChatConversations
component.
CometChatConversations
component.
CometChatConversations
component.
CometChatConversations
component.
MessageSentAtDateTimeFormat
property allows you to customize the Message Sent At timestamp displayed in the Search.
Default Date Time Format:
CalendarObject
.