AI Integration Quick Reference
AI Integration Quick Reference
Where It Fits
CometChatConversations is a sidebar list component. It renders recent conversations and emits the selected CometChat.Conversation via onItemClick. Wire it to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer to build a standard two-panel chat layout.

Minimal Render

.cometchat-conversations
Filtering Conversations
Pass aCometChat.ConversationsRequestBuilder to conversationsRequestBuilder. Pass the builder instance — not the result of .build().
Filter Recipes
Default page size is 30. The component uses infinite scroll — the next page loads as the user scrolls to the bottom.
Refer to ConversationRequestBuilder for the full builder API.
Actions and Events
Callback Props
onItemClick
Fires when a conversation row is tapped. Primary navigation hook — set the active conversation and render the message view.onSelect
Fires when a conversation is checked/unchecked in multi-select mode. RequiresselectionMode to be set.
onError
Fires on internal errors (network failure, auth issue, SDK exception).onSearchBarClicked
Fires when the search bar is clicked. RequiresshowSearchBar={true}.
Global UI Events
CometChatConversationEvents emits events subscribable from anywhere in the application. Subscribe in a useEffect and unsubscribe on cleanup.
When to use: sync external UI with conversation state changes. For example, update an unread count badge in a tab bar when
ccMarkConversationAsRead fires, or remove a conversation from a custom sidebar when ccConversationDeleted fires.
SDK Events (Real-Time, Automatic)
The component listens to these SDK events internally. No manual attachment needed unless additional side effects are required.
Automatic: new messages, typing indicators, receipts, user presence, group membership changes.
Manual: deleting a conversation via the SDK directly (not through the component’s context menu) requires emitting
CometChatConversationEvents.ccConversationDeleted for the UI to update.
In React 18 StrictMode,
useEffect runs twice on mount in development. The component handles listener cleanup internally, but any additional listeners added alongside the component need cleanup in the useEffect return function to avoid duplicate event handling.Custom View Slots
Each slot replaces a section of the default UI. Slots that accept a conversation parameter receive theCometChat.Conversation object for that row.
itemView
Replace the entire list item row. Default:

- TypeScript
- CSS
leadingView
Replace the avatar / left section. Typing-aware avatar example.
trailingView
Replace the timestamp / badge / right section. Relative time badge example.
- TypeScript
- CSS
titleView
Replace the name / title text. Inline user status example.
- TypeScript
- CSS
subtitleView
Replace the last message preview text. Default:

- TypeScript
- CSS
headerView
Replace the entire header bar.
- TypeScript
- CSS
options
Replace the context menu / hover actions on each conversation item. Default:

- TypeScript
- CSS
textFormatters
Custom text formatters for the conversation subtitle. Array ofCometChatTextFormatter instances. If not provided, default formatters from the data source are used.
lastMessageDateTimeFormat
Customize the last message timestamp format using aCalendarObject.
If no property is passed in the CalendarObject, the component checks the global configuration first. If also missing there, the component’s default formatting applies.
Common Patterns
Custom empty state with CTA
Hide all chrome — minimal list
Conversations with search
CSS Architecture
The component uses CSS custom properties (design tokens) defined in@cometchat/chat-uikit-react/css-variables.css. The cascade:
- Global tokens (e.g.,
--cometchat-primary-color,--cometchat-background-color-01) are set on the.cometchatroot wrapper. - Component CSS (
.cometchat-conversations) consumes these tokens viavar()with fallback values. - Overrides target
.cometchat-conversationsdescendant selectors in a global stylesheet.
CometChatConversations exist on the same page, wrap the component in a container and scope selectors:
Key Selectors
Example: Brand-themed conversations

Customization Matrix
Props
All props are optional. Sorted alphabetically.activeConversation
Highlights the specified conversation in the list.
Must be a reference-equal object from the SDK; a manually constructed object will not match.
conversationsRequestBuilder
Controls which conversations load and in what order.
Pass the builder instance, not the result of
.build().
customSoundForMessages
URL to a custom audio file for incoming message notifications.
Must be a valid audio URL accessible from the browser.
disableSoundForMessages
Disables the notification sound for incoming messages.emptyView
Custom component displayed when there are no conversations.errorView
Custom component displayed when an error occurs.
Hidden when
hideError={true}.
headerView
Custom component rendered as the entire header bar.hideDeleteConversation
Hides the delete option in the context menu.hideError
Hides the default and custom error views.
Also suppresses
errorView if set.
hideGroupType
Hides the group type icon (public/private/password).hideReceipts
Hides message read/delivery receipt indicators.hideUserStatus
Hides the online/offline status indicator.itemView
Custom renderer for the entire list item row.lastMessageDateTimeFormat
Format for displaying the timestamp of the last message.leadingView
Custom renderer for the avatar / left section.loadingView
Custom component displayed during the loading state.onError
Callback fired when the component encounters an error.onItemClick
Callback fired when a conversation row is clicked.onSearchBarClicked
Callback fired when the search bar is clicked. RequiresshowSearchBar={true}.
onSelect
Callback fired when a conversation is selected/deselected. RequiresselectionMode to be set.
options
Custom context menu / hover actions for each conversation item.searchView
Custom search bar component in the header.selectionMode
Enables single or multi-select checkboxes on list items.onSelect to capture selections.
showScrollbar
Shows the scrollbar in the conversation list.showSearchBar
Shows a search bar at the top of the list.subtitleView
Custom renderer for the last message preview text.textFormatters
Custom text formatters for the conversation subtitle.
See CometChatMentionsFormatter for mention formatting.
titleView
Custom renderer for the name / title text.trailingView
Custom renderer for the timestamp / badge / right section.Events
All events are
Subject<CometChat.Conversation> from RxJS. Subscribe with .subscribe(), unsubscribe with the returned subscription’s .unsubscribe().