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 onItemPress. Wire it to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer to build a standard chat layout.

Minimal Render
Filtering Conversations
Pass aCometChat.ConversationsRequestBuilder to conversationsRequestBuilder. Pass the builder instance — not the result of .build().
Filter Recipes
| Recipe | Code |
|---|---|
| Only user conversations | new CometChat.ConversationsRequestBuilder().setConversationType("user") |
| Only group conversations | new CometChat.ConversationsRequestBuilder().setConversationType("group") |
| Limit to 10 per page | new CometChat.ConversationsRequestBuilder().setLimit(10) |
| With specific tags | new CometChat.ConversationsRequestBuilder().setTags(["vip"]) |
| Filter by user tags | new CometChat.ConversationsRequestBuilder().withUserAndGroupTags(true).setUserTags(["premium"]) |
| Filter by group tags | new CometChat.ConversationsRequestBuilder().withUserAndGroupTags(true).setGroupTags(["support"]) |
Actions and Events
Callback Props
onItemPress
Fires when a conversation row is tapped. Primary navigation hook — set the active conversation and render the message view.onItemLongPress
Fires when a conversation item is long-pressed, allowing additional actions like delete or select.onSelection
Fires when conversations are selected/deselected in selection mode. RequiresselectionMode to be set.
onError
Fires on internal errors (network failure, auth issue, SDK exception).onEmpty
Fires when the conversation list is empty.onLoad
Fires when the list is successfully fetched and loaded.Global UI Events
CometChatUIEventHandler emits events subscribable from anywhere in the application. Subscribe in a useEffect and unsubscribe on cleanup.
| Event | Fires when | Payload |
|---|---|---|
ccConversationDeleted | A conversation is deleted from the list | CometChat.Conversation |
SDK Events (Real-Time, Automatic)
The component listens to these SDK events internally. No manual attachment needed unless additional side effects are required.| SDK Listener | Internal behavior |
|---|---|
onTextMessageReceived / onMediaMessageReceived / onCustomMessageReceived | Moves conversation to top, updates last message preview and unread count |
onTypingStarted / onTypingEnded | Shows/hides typing indicator in the subtitle |
onMessagesDelivered / onMessagesRead | Updates receipt ticks (unless receiptsVisibility={false}) |
onUserOnline / onUserOffline | Updates online/offline status dot (unless usersStatusVisibility={false}) |
onGroupMemberJoined / onGroupMemberLeft / onGroupMemberKicked / onGroupMemberBanned / onMemberAddedToGroup | Updates group conversation metadata |
ccConversationDeleted for the UI to update.
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.
| Slot | Signature | Replaces |
|---|---|---|
ItemView | (conversation: CometChat.Conversation) => JSX.Element | Entire list item row |
LeadingView | (conversation: CometChat.Conversation) => JSX.Element | Avatar / left section |
TitleView | (conversation: CometChat.Conversation) => JSX.Element | Name / title text |
SubtitleView | (conversation: CometChat.Conversation) => JSX.Element | Last message preview |
TrailingView | (conversation: CometChat.Conversation) => JSX.Element | Timestamp / badge / right section |
LoadingView | () => JSX.Element | Loading spinner |
EmptyView | () => JSX.Element | Empty state |
ErrorView | () => JSX.Element | Error state |
AppBarOptions | () => JSX.Element | Header bar options |
SearchView | () => JSX.Element | Search bar |
ItemView
Replace the entire list item row.
LeadingView
Replace the avatar / left section.
TrailingView
Replace the timestamp / badge / right section.
TitleView
Replace the name / title text.SubtitleView
Replace the last message preview text.
AppBarOptions
Custom view for the header bar options.
options
Custom context menu actions for each conversation item.
addOptions
Extends the default context menu actions with additional options.
datePattern
Custom date format for displaying timestamps.
textFormatters
Custom text formatters for the conversation subtitle.
Common Patterns
Custom empty state with CTA
Hide all chrome — minimal list
Conversations with search
Multi-select with submit
Styling
The component uses the theme system fromCometChatThemeProvider. Pass a style prop to customize the appearance.

Style Properties
| Property | Type | Description |
|---|---|---|
containerStyle | ViewStyle | Style for the root container |
headerStyle | ViewStyle | Style for the header section |
titleStyle | TextStyle | Style for the header title |
itemStyle | object | Style for list items (includes avatarStyle, badgeStyle, titleStyle, subtitleStyle) |
searchStyle | object | Style for the search bar |
Props
All props are optional unless noted.conversationsRequestBuilder
Controls which conversations load and in what order.| Type | CometChat.ConversationsRequestBuilder |
| Default | SDK default (30 per page) |
.build().
customSoundForMessages
Custom sound file for incoming message notifications.| Type | audio source |
| Default | Built-in sound |
datePattern
Custom function to format conversation timestamps.| Type | (conversation: CometChat.Conversation) => string |
| Default | Component default |
deleteConversationOptionVisibility
Shows/hides the delete option in the context menu.| Type | boolean |
| Default | true |
disableSoundForMessages
Disables the notification sound for incoming messages.| Type | boolean |
| Default | false |
EmptyView
Custom component displayed when there are no conversations.| Type | () => JSX.Element |
| Default | Built-in empty state |
ErrorView
Custom component displayed when an error occurs.| Type | () => JSX.Element |
| Default | Built-in error state |
groupTypeVisibility
Shows/hides the group type icon (public/private/password).| Type | boolean |
| Default | true |
hideBackButton
Hides the back button in the header.| Type | boolean |
| Default | true |
hideError
Hides the error state view.| Type | boolean |
| Default | false |
hideHeader
Hides the entire header bar.| Type | boolean |
| Default | false |
hideSubmitButton
Hides the submit button when selection mode is enabled.| Type | boolean |
| Default | true |
ItemView
Custom renderer for the entire list item row.| Type | (conversation: CometChat.Conversation) => JSX.Element |
| Default | Built-in list item |
LeadingView
Custom renderer for the avatar / left section.| Type | (conversation: CometChat.Conversation) => JSX.Element |
| Default | Built-in avatar |
LoadingView
Custom component displayed during the loading state.| Type | () => JSX.Element |
| Default | Built-in loading indicator |
onBack
Callback fired when the back button is pressed.| Type | () => void |
| Default | undefined |
onEmpty
Callback fired when the conversation list is empty.| Type | () => void |
| Default | undefined |
onError
Callback fired when the component encounters an error.| Type | (error: CometChat.CometChatException) => void |
| Default | undefined |
onItemLongPress
Callback fired when a conversation row is long-pressed.| Type | (conversation: CometChat.Conversation) => void |
| Default | undefined |
onItemPress
Callback fired when a conversation row is tapped.| Type | (conversation: CometChat.Conversation) => void |
| Default | undefined |
onLoad
Callback fired when conversations are loaded.| Type | (list: CometChat.Conversation[]) => void |
| Default | undefined |
onSearchBarClicked
Callback fired when the search bar is clicked. RequiresshowSearchBar={true}.
| Type | () => void |
| Default | undefined |
onSearchTextChanged
Callback fired when search text changes. RequiresshowSearchBar={true}.
| Type | (searchText: string) => void |
| Default | undefined |
onSelection
Callback fired when conversations are selected/deselected. RequiresselectionMode to be set.
| Type | (conversations: Array<CometChat.Conversation>) => void |
| Default | undefined |
onSubmit
Callback fired when the submit button is pressed. RequiresselectionMode to be set.
| Type | (conversations: Array<CometChat.Conversation>) => void |
| Default | undefined |
receiptsVisibility
Shows/hides message read/delivery receipt indicators.| Type | boolean |
| Default | true |
SearchView
Custom search bar component.| Type | () => JSX.Element |
| Default | Built-in search bar |
selectionMode
Enables single or multi-select mode on list items.| Type | "single" | "multiple" | "none" |
| Default | "none" |
searchText
Current search text value for the search bar.| Type | string |
| Default | "" |
showSearchBar
Shows a search bar at the top of the list.| Type | boolean |
| Default | false |
SubtitleView
Custom renderer for the last message preview text.| Type | (conversation: CometChat.Conversation) => JSX.Element |
| Default | Built-in subtitle |
textFormatters
Custom text formatters for the conversation subtitle.| Type | CometChatTextFormatter[] |
| Default | Default formatters from data source |
TitleView
Custom renderer for the name / title text.| Type | (conversation: CometChat.Conversation) => JSX.Element |
| Default | Built-in title |
TrailingView
Custom renderer for the timestamp / badge / right section.| Type | (conversation: CometChat.Conversation) => JSX.Element |
| Default | Built-in trailing view |
usersStatusVisibility
Shows/hides the online/offline status indicator.| Type | boolean |
| Default | true |