Skip to main content
FieldValue
Package@cometchat/chat-uikit-react
Required setupCometChatUIKit.init() + CometChatUIKit.login() before rendering any component
Callback actionson<Event>={(param) => {}}
Data filtering<entity>RequestBuilder={new CometChat.<Entity>RequestBuilder()}
Toggle featureshide<Feature>={true} or show<Feature>={true}
Custom rendering<slot>View={(<params>) => JSX}
CSS overridesTarget .cometchat-<component> class in global CSS
CallingRequires separate @cometchat/calls-sdk-javascript package

Architecture

The UI Kit is a set of independent components that compose into chat layouts. A typical two-panel layout uses four core components:
  • CometChatConversations — sidebar listing recent conversations (users and groups)
  • CometChatMessageHeader — toolbar showing avatar, name, online status, and typing indicator
  • CometChatMessageList — scrollable message feed with reactions, receipts, and threads
  • CometChatMessageComposer — rich text input with attachments, mentions, and voice notes
Data flow: selecting a conversation in CometChatConversations yields a CometChat.User or CometChat.Group object. That object is passed as a prop (user or group) to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer. The message components use the SDK internally — CometChatMessageComposer sends messages, CometChatMessageList receives them via real-time listeners. Components communicate through a publish/subscribe event bus (CometChatMessageEvents, CometChatConversationEvents, CometChatGroupEvents, etc.). A component emits events that other components or application code can subscribe to without direct references. See Events for the full list. Each component accepts callback props (on<Event>), view slot props (<slot>View) for replacing UI sections, RequestBuilder props for data filtering, and CSS variable overrides on .cometchat-<component> classes.

Component Catalog

All components are imported from @cometchat/chat-uikit-react.

Conversations and Lists

ComponentPurposeKey PropsPage
CometChatConversationsScrollable list of recent conversationsconversationsRequestBuilder, onItemClick, onErrorConversations
CometChatUsersScrollable list of usersusersRequestBuilder, onItemClick, onErrorUsers
CometChatGroupsScrollable list of groupsgroupsRequestBuilder, onItemClick, onErrorGroups
CometChatGroupMembersScrollable list of group membersgroup, groupMemberRequestBuilder, onItemClickGroup Members

Messages

ComponentPurposeKey PropsPage
CometChatMessageHeaderToolbar with avatar, name, status, typing indicatoruser, group, enableAutoSummaryGenerationMessage Header
CometChatMessageListScrollable message list with reactions, receipts, threadsuser, group, messagesRequestBuilder, goToMessageId (string)Message List
CometChatMessageComposerRich text input with attachments, mentions, voice notesuser, group, onSendButtonClick, placeholderTextMessage Composer
CometChatMessageTemplatePre-defined structure for custom message bubblestype, category, contentView, headerView, footerViewMessage Template
CometChatThreadHeaderParent message bubble and reply count for threaded viewparentMessage, onClose, hideReceipts, textFormattersThread Header

Calling

ComponentPurposeKey PropsPage
CometChatCallButtonsVoice and video call initiation buttonsuser, group, onVoiceCallClick, onVideoCallClickCall Buttons
CometChatIncomingCallIncoming call notification with accept/declinecall, onAccept(call), onDecline(call)Incoming Call
CometChatOutgoingCallOutgoing call screen with cancel controlcall, onCloseClickedOutgoing Call
CometChatCallLogsScrollable list of call historycallLogsRequestBuilder, onItemClickCall Logs

Search and AI

ComponentPurposeKey PropsPage
CometChatSearchReal-time search across conversations and messagesonConversationClicked(conversation, searchKeyword?), onMessageClicked(message, searchKeyword?), uid, guid, textFormattersSearch
CometChatAIAssistantChatAI agent chat with streaming, suggestions, historyuser, onSendButtonClick(message, previewMessageMode?), aiAssistantToolsAI Assistant Chat

Component API Pattern

All components share a consistent API surface.

Actions

Actions control component behavior. They split into two categories: Predefined Actions are built into the component and execute automatically on user interaction (e.g., clicking send dispatches the message). No configuration needed. User-Defined Actions are callback props that fire on specific events. Override them to customize behavior:
<CometChatMessageList
  user={chatUser}
  onThreadRepliesClick={(message) => openThreadPanel(message)}
  onError={(error) => logError(error)}
/>

Events

Events enable decoupled communication between components. A component emits events that other parts of the application can subscribe to without direct references.
import { CometChatMessageEvents } from "@cometchat/chat-uikit-react";

const sub = CometChatMessageEvents.ccMessageSent.subscribe((message) => {
  // react to sent message
});

// cleanup
sub?.unsubscribe();
Each component page documents its emitted events in the Events section.

Filters

List-based components accept RequestBuilder props to control which data loads:
<CometChatMessageList
  user={chatUser}
  messagesRequestBuilder={
    new CometChat.MessagesRequestBuilder().setLimit(20)
  }
/>

Custom View Slots

Components expose named view slots to replace sections of the default UI:
<CometChatMessageHeader
  user={chatUser}
  titleView={<CustomTitle />}
  subtitleView={<CustomSubtitle />}
  leadingView={<CustomAvatar />}
/>

CSS Overrides

Every component has a root CSS class (.cometchat-<component>) for style customization:
.cometchat-message-list .cometchat-text-bubble__body-text {
  font-family: "SF Pro";
}

Next Steps