MessageList
is a composite component that displays a list of messages and effectively manages real-time operations. It includes various types of messages such as Text Messages, Media Messages, Stickers, and more.
User
or Group
Object.onThreadRepliesClick
is triggered when you click on the threaded message bubble. The onThreadRepliesClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
onReactionClick
is triggered when you click on the reaction item of the message bubble. The onReactionClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
onReactionListItemClick
is triggered when you click on the reaction list item of the reaction list. The onReactionListItemClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
MessagesRequestBuilder
in the MessageList Component to customize your message list. Numerous options are available to alter the builder to meet your specific needs. For additional details on MessagesRequestBuilder
, please visit MessagesRequestBuilder.
In the example below, we are applying a filter to the messages based on a search substring and for a specific user. This means that only messages that contain the search term and are associated with the specified user will be displayed
ReactionsRequestBuilder
in the MessageList Component to customize and fetch the reactions for the messages. Numerous options are available to alter the builder to meet your specific needs.
Component
. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.
The list of events emitted by the Message List component is as follows.
Event | Description |
---|---|
ccOpenChat | this event alerts the listeners if the logged-in user has opened a user or a group chat. |
ccMessageEdited | Triggers whenever a loggedIn user edits any message from the list of messages .it will have three states such as: inProgress, success and error. |
ccMessageDeleted | Triggers whenever a loggedIn user deletes any message from the list of messages. |
ccActiveChatChanged | This event is triggered when the user navigates to a particular chat window. |
ccMessageRead | Triggers whenever a loggedIn user reads any message. |
CometChatMessageEvents
Listener’s
CometChatMessageEvents
Listener’s
Property | Description | Code |
---|---|---|
Hide Date Separator | Hides the visibility of the date separator in the message list. | hideDateSeparator={true} |
Hide Sticky Date | Hides the sticky date header in the message list. | hideStickyDate={true} |
Hide Receipts | Hides the visibility of receipts in the message list. | hideReceipts={true} |
Hide Error | Hides the default & custom error view passed in the errorView prop. | hideError={true} |
Hide Reply In Thread Option | Hides the option to reply to messages in a thread. | hideReplyInThreadOption={true} |
Hide Translate Message Option | Hides the option to translate messages. | hideTranslateMessageOption={true} |
Hide Edit Message Option | Hides the option to edit messages. | hideEditMessageOption={true} |
Hide Delete Message Option | Hides the option to delete messages. | hideDeleteMessageOption={true} |
Hide Reaction Option | Hides the option to react to messages. | hideReactionOption={true} |
Hide Message Privately Option | Hides the option to message a user privately. | hideMessagePrivatelyOption={true} |
Hide Copy Message Option | Hides the option to copy messages. | hideCopyMessageOption={true} |
Hide Message Info Option | Hides the option to view message information. | hideMessageInfoOption={true} |
Hide Avatar | Hides avatars for messages. | hideAvatar={true} |
Hide Group Action Messages | Hides group action messages. | hideGroupActionMessages={true} |
Hide Conversation Starters | Hides the visibility of the conversation starters in the message list. | hideConversationStarters={true} |
Hide Smart Replies | Hides the visibility of the smart replies in the message list. | hideSmartReplies={true} |
Parent Message ID | Unique identifier of the parent message for displaying threaded conversations. | parentMessageId={1234} |
User | A CometChat.User object representing the participant of the chat. | user={chatUser} |
Group | A CometChat.Group object representing the group whose chat messages are displayed. | group={chatGroup} |
Message Alignment | Specifies the alignment of messages in the list (e.g., left, right). | messageAlignment={MessageListAlignment.left} |
Scroll To Bottom On New Messages | Automatically scrolls the message list to the bottom when a new message arrives. | scrollToBottomOnNewMessages={true} |
Quick Options Count | Specifies how many message options are visible in the main menu by default. | quickOptionsCount={3} |
Disable Sound For Messages | Disables the sound effect when new messages arrive. | disableSoundForMessages={true} |
Custom Sound For Messages | Specifies a custom sound file to play when new messages arrive. | customSoundForMessages="sound.mp3" |
Smart Replies Keywords | Sets the keywords on which the smart replies should be triggered in the message list. | smartRepliesKeywords={['why', 'how']} |
Smart Replies Delay Duration | Sets the delay duration (in milliseconds) before smart replies are shown. | smartRepliesDelayDuration={5000} |
Empty View | Custom empty state view to display when there are no messages. | emptyView={<EmptyState />} |
Error View | A custom view displayed when there are no messages. | errorView={<ErrorComponent />} |
Loading View | A custom view displayed while messages are being fetched. | loadingView={<LoadingSpinner />} |
Go To MessageId | The ID of the message that the list should automatically scroll to when it is first loaded. | goToMessageId={1} |
separatorDateTimeFormat
property allows you to customize the Date Separator timestamp displayed in the Message List.
Default Date Time Format:
CalendarObject
.
stickyDateTimeFormat
property allows you to customize the Sticky Date timestamp displayed in the Message List.

Default Date Time Format:
CalendarObject
.
messageSentAtDateTimeFormat
property allows you to customize the Message SentAt timestamp displayed in the Message List.
Default Date Time Format:
CalendarObject
.
messageInfoDateTimeFormat
property allows you to customize the Message Info timestamp displayed in the Message List.
Default Date Time Format:
CalendarObject
.