AI Integration Quick Reference
AI Integration Quick Reference
Where It Fits
CometChatSearch is a standalone search panel that searches across conversations and messages simultaneously. It renders filter chips, conversation results, and message results in a unified interface. Wire onConversationClicked and onMessageClicked to navigate to the selected result.

Minimal Render
.cometchat-search
Filtering Search Results
Search Scope
Control which entities are searched usingsearchIn with CometChatSearchScope.
Search Filters
Control which filter chips appear usingsearchFilters with CometChatSearchFilter.
Request Builders
PassConversationsRequestBuilder and MessagesRequestBuilder to customize the underlying SDK queries.
Scoped Search (User or Group)
Limit search to a specific user or group conversation usinguid or guid.
Actions and Events
Callback Props
onConversationClicked
Fires when a conversation is clicked in search results.onMessageClicked
Fires when a message is clicked in search results.onBack
Fires when the back button is clicked.onError
Fires on internal errors during search.Global UI Events
TheCometChatSearch component does not emit any custom UI events.
SDK Events (Real-Time, Automatic)
The component does not attach SDK listeners. Search is on-demand, not real-time.Custom View Slots
The component exposes separate view slots for conversation results and message results. All per-item slots receive their respective data object.
Conversation view slots follow the same pattern as CometChatConversations. Refer to that component for detailed examples.
messageItemView
Replace the entire message list item in search results.
- TypeScript
- CSS
messageLeadingView
Replace the message avatar / left section.
- TypeScript
- CSS
messageTitleView
Replace the message title text.
- TypeScript
- CSS
messageSubtitleView
Replace the message subtitle text.
- TypeScript
- CSS
messageTrailingView
Replace the message right section.
- TypeScript
- CSS
messageSentAtDateTimeFormat
Customize the message timestamp format using aCalendarObject.
Common Patterns
Messages-only search
Photos and videos filter only
Search within a specific group
CSS Architecture
The component uses CSS custom properties (design tokens) defined in@cometchat/chat-uikit-react/css-variables.css. The cascade:
- Global tokens set on the
.cometchatroot wrapper. - Component CSS (
.cometchat-search) consumes these tokens viavar(). - Overrides target
.cometchat-searchdescendant selectors.
Key Selectors
Example: Themed search
Customization Matrix
Props
All props are optional. Sorted alphabetically.conversationItemView
Custom renderer for the entire conversation list item in search results.conversationLeadingView
Custom renderer for the conversation avatar / left section.conversationOptions
Custom context menu actions for conversation items.conversationsRequestBuilder
Controls which conversations appear in search results.conversationSubtitleView
Custom renderer for the conversation subtitle.conversationTitleView
Custom renderer for the conversation title.conversationTrailingView
Custom renderer for the conversation trailing section.emptyView
Custom component displayed when no search results are found.errorView
Custom component displayed when an error occurs.guid
Limits search to messages in a specific group.hideBackButton
Hides the back button.hideGroupType
Hides the group type icon in conversation results.hideReceipts
Hides message read/delivery receipt indicators.hideUserStatus
Hides the online/offline status indicator.initialSearchFilter
The filter active by default on load.initialView
Custom component displayed before the user enters a search query.loadingView
Custom component displayed during search loading.messageItemView
Custom renderer for the entire message list item in search results.messageLeadingView
Custom renderer for the message avatar / left section.messageSentAtDateTimeFormat
Format for message timestamps.
Falls back to global calendar configuration if not set.
messagesRequestBuilder
Controls which messages appear in search results.messageSubtitleView
Custom renderer for the message subtitle.messageTitleView
Custom renderer for the message title.messageTrailingView
Custom renderer for the message trailing section.onBack
Callback fired when the back button is clicked.onConversationClicked
Callback fired when a conversation is clicked in search results.onError
Callback fired when the component encounters an error.onMessageClicked
Callback fired when a message is clicked in search results.searchFilters
Filters rendered in the search filter bar.searchIn
Scopes to search in.textFormatters
Custom text formatters for message content.uid
Limits search to messages with a specific user.Events
TheCometChatSearch component does not emit any custom UI events.