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

Live Preview — interact with the default conversations list.Open in Storybook ↗
The component handles:
- Paginated fetching with infinite scroll
- Real-time updates (new messages, typing indicators, presence changes)
- Search filtering
- Selection mode (single/multiple)
Usage
Flat API
Compound Composition
Full Layout Example
Filtering
Pass aCometChat.ConversationsRequestBuilder to conversationsRequestBuilder to control which conversations load. Pass the builder instance — not the result of .build().
Search
The component includes a built-in search bar. When the user types, it filters conversations client-side by name. For server-side search, pass asearchRequestBuilder:
CometChatSearch), pass onSearchBarClicked:
Filter Recipes
Actions and Events
Callback Props
Events Emitted
UI events this component publishes:Events Received
UI events this component subscribes to (published by other components):SDK Listeners (Automatic)
These SDK listeners are attached internally. The component updates its state automatically — no manual subscription needed:- Message listeners:
onTextMessageReceived,onMediaMessageReceived,onCustomMessageReceived,onInteractiveMessageReceived - Typing:
onTypingStarted,onTypingEnded - Receipts:
onMessagesDelivered,onMessagesRead - Presence:
onUserOnline,onUserOffline - Groups:
onGroupMemberJoined,onGroupMemberLeft,onGroupMemberKicked,onGroupMemberBanned,onMemberAddedToGroup
Customization
View Props
Use view props to replace sections of the default UI while keeping the component’s behavior intact:itemView
Replace the entire list item row. Default:

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

- TypeScript
- CSS
trailingView
Replace the timestamp / badge / right section. Relative time badge example.
- TypeScript
- CSS
headerView
Replace the entire header bar.
- TypeScript
- CSS
Compound Composition
For full layout control, use sub-components. Omit any sub-component to hide it:CSS Styling
Override design tokens on the component selector:Props
All props are optional.View slot props (
headerView, searchView, loadingView, emptyView, errorView, itemView, leadingView, titleView, subtitleView, trailingView) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.conversationsRequestBuilder
Custom request builder for fetching conversations. Controls pagination, filtering, and sorting.searchRequestBuilder
Custom request builder used specifically when the user searches. Separate from the main builder.searchKeyword
Initial search keyword to pre-filter conversations on mount.activeConversation
The currently active/highlighted conversation. The matching item receives an active visual state.lastMessageDateTimeFormat
Custom date/time format for the last message timestamp shown in each conversation item.hideReceipts
Hide message delivery/read receipts (double ticks) on conversation items.hideUserStatus
Hide the online/offline status indicator on user avatars.hideGroupType
Hide the group type indicator (public/private/password) on group conversation items.hideUnreadCount
Hide the unread message count badge.hideDeleteConversation
Hide the delete option in the conversation item’s context menu.showSearchBar
Whether to show the search bar. Set tofalse to hide it entirely.
showScrollbar
Show the native scrollbar on the conversation list.selectionMode
Enable selection mode for multi-select operations.disableSoundForMessages
Disable the notification sound when new messages arrive.customSoundForMessages
Custom sound URL to play when new messages arrive (replaces the built-in sound).onItemClick
Callback when a conversation item is clicked.onSelect
Callback when a conversation is selected or deselected (only fires in selection mode).onError
Callback when an SDK error occurs during fetch or real-time operations.onEmpty
Callback when the conversation list is empty after the initial fetch completes.onSearchBarClicked
Callback when the search bar is clicked. When provided, the search input becomes read-only and acts as a trigger (useful for opening a global search component likeCometChatSearch).
CSS Architecture
The component uses CSS custom properties (design tokens) that are bundled with@cometchat/chat-uikit-react. 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
Next Steps
Users
Browse and select users for new conversations
Message List
Display messages for the selected conversation
Search
Search across conversations and messages
Theming
Customize colors, fonts, and spacing