OnItemClick
is triggered when you click on a ListItem of the Conversations component. The OnItemClick
action doesn’t have a predefined behavior. You can override this action using the following code snippet.
OnSelect
event is triggered upon the completion of a selection in SelectionMode
. It does not have a default behavior. However, you can override its behavior using the following code snippet.
ConversationsRequestBuilder
in the Conversations Component to filter the conversation list. You can modify the builder as per your specific requirements with multiple options available to know more refer to ConversationRequestBuilder.
You can set filters using the following parameters.
User
or Groups
Tag
Tag
Tag
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.
ConversationsStyle
to the Conversations
Component to customize the styling.
Name | Description |
---|---|
width | Sets the width of the component |
height | Sets the height of the component |
border | Sets the border of the component |
borderRadius | Sets the border radius of the component |
background | Sets all background style properties at once, such as color, image, origin and size, or repeat method. Reference link |
boxShadow | Adds shadow effects around the component. |
titleTextFont | Sets all the different properties of font for the heading text. Reference link |
titleTextColor | Sets the foreground color of heading text. |
loadingIconTint | Sets the tint or color applied to the loading indicator icon of the component |
emptyStateTextFont | Sets all the different properties of font for the placeholder text. Reference link |
emptyStateTextColor | Sets the foreground color of placeholder text displayed in the component. |
errorStateTextFont | Sets all the different properties of font for the error message. Reference link |
errorStateTextColor | Sets the foreground color of error message displayed in the component. |
lastMessageTextFont | Sets all the different properties of font for the last message. Reference link |
lastMessageTextColor | Sets the foreground color of the last message. |
typingIndictorTextFont | Sets all the different properties of font for the typing indicator text. Reference link |
typingIndictorTextColor | Sets the foreground color of typing indicator text |
threadIndicatorTextFont | Sets all the different properties of font for the thread indicator text. Reference link |
threadIndicatorTextColor | Sets the foreground color of thread indicator text. |
onlineStatusColor | Sets the color of the status indicator representing the user’s online status |
privateGroupIconBackground | Sets the background of the status indicator representing private groups. |
passwordGroupIconBackground | Sets the background of the status indicator representing password protected groups. |
Avatar
component in the Conversations
Component, you can use the following code snippet. For more information, visit Avatar Styles.
Conversations
Component, you can use the following code snippet. For more information, visit Status Indicator Styles.
Date
component in the Conversations
Component, you can use the following code snippet. For more information, visit Date Styles.
Badge
component in the Conversations
Component, you can use the following code snippet. For more information, visit Badge Styles.
receipt
component in the Conversations
Component, you can use the following code snippet. For more information, visit Receipts.
Backdrop
component in the Conversations
Component, you can use the following code snippet, you can use the following code snippet. For more information, visit Backdrop Styles.
delete dialog
component in the Conversations
Component, you can use the following code snippet. For more information, visit Delete dialog Styles.
ListItemStyle
component in the Conversations
Component, you can use the following code snippet. For more information, visit List Item.
Property | Description | Code |
---|---|---|
Title | Used to set custom title in the app bar. | title="Your Custom Title" |
EmptyState Text | Used to set a custom text response when fetching the conversations has returned an empty list | emptyStateText="Your Custom Empty State text" |
Selection Mode | Used to set a custom text response when fetching the conversations has returned an empty list | selectionMode={SelectionMode.multiple} |
PasswordGroup Icon | Used to set icon shown in place of status indicator for password protected group | passwordGroupIcon="https://icon.svg" |
privateGroupIcon | Used to set icon shown in place of status indicator for private group | privateGroupIcon="https://icon.svg" |
SentIcon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is sent | sentIcon="your custom sent icon" |
Delivered Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is delivered | deliveredIcon="your custom delivered icon" |
Read Icon | Used to customize the receipt icon shown in the subtitle of the conversation item if hideReceipt is false and if the status of the last message in the conversation is read | readIcon="your custom read icon" |
errorIcon | Asset URL for the error state indicating that an error has occurred when the message was in transit. | errorIcon="your custom error icon" |
Hide Error | Used to hide error on fetching conversations | hideError={true} |
Hide Separator | Used to control visibility of Separators in the list view | hideSeparator={true} |
Disable UsersPresence | Used to control visibility of status indicator shown if user is online | disableUsersPresence={true} |
Hide Receipt | Used to control the visibility of read receipts without affecting the functionality of marking messages as read and delivered | hideReceipt={false} |
Disable Typing | Used to toggle visibility of typing indicator | disableTyping={true} |
Disable Mentions | Sets whether mentions in text should be disabled. Processes the text formatters If there are text formatters available and the disableMentions flag is set to true, it removes any formatters that are instances of CometChatMentionsFormatter. | disableMentions={true} |
disableSoundForMessages | When set to true, the component will not produce sound for all incoming messages.indicator | disableSoundForMessages={true} |
customSoundForMessages | mp3 file asset of your choice. | customSoundForMessages="your custom sound for messages" |
activeConversation report | Used to set the active conversation | activeConversation={activeConversation} |
getListItemView
function as follows:
getMenus
function as follows:
Name | Description |
---|---|
time | Date format displayed in the format hh:mm a |
DayDate | Date format displayed as: 1) If timestamp < 24hrs: “Today” 2) If timestamp < 48hrs: “Yesterday” 3) If timestamp < 7 days display “EEE” i.e , SUNDAY 4) else display “d MMM, yyyy” |
DayDateTime | Date format displayed as: 1) If timestamp < 24hrs: “hh:mm a” 2) If timestamp < 48hrs: “Yesterday” 3) If timestamp < 7 days display “EEE” i.e SUNDAY 4) else display “dd MM yyyy” |
getSubtitleView
function as follows:
Name | Description |
---|---|
id | Unique identifier for each option |
title | Heading text for each option |
titleFont | Sets all the different properties of font for the option text. Reference link |
titleColor | Sets the foreground color of option text |
iconURL | Sets the asset URL of the icon for each option |
iconTint | Sets the tint or color applied to each option |
backgroundColor | Sets the background color of each option |
onClick | Method to be invoked when user clicks on each option |
loadingStateView
to match the loading view of your app.
getLoadingStateView
function as follows:
ErrorStateView
to match the error view of your app.
getErrorStateView
function as follows: