Skip to main content

Overview

The Conversations is a Component, that shows all conversations related to the currently logged-in user. This component lists the most recent or latest conversations or contacts with whom you have exchanged messages. It provides a convenient way to quickly access and resume conversations with the people you have been in contact with recently.

Usage

Integration

Actions

Actions dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.

1. OnItemClick

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.

2. OnSelect

The 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.

3. OnError

This action doesn’t change the behavior of the component but rather listens for any errors that occur in the Conversations component.

Filters

You can set 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.
  1. Conversation Type: Filters on type of Conversation, User or Groups
  2. Limit: Number of conversations fetched in a single request.
  3. WithTags: Filter on fetching conversations containing tags
  4. Tags: Filters on specific Tag
  5. UserTags: Filters on specific User Tag
  6. GroupTags: Filters on specific Group Tag

Events

Events are emitted by a 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.

Customization

To fit your app’s design requirements, you can customize the appearance of the conversation component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.

Style

Using CSS you can customize the look and feel of the component in your app like the color, size, shape, and fonts.

Functionality

These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements.
Below is a list of customizations along with corresponding code snippets

Advanced

For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.

ItemView

With this function, you can assign a custom ListItem to the Conversations Component. Shown below is the default chat interface.
The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.

LeadingView

The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.

TrailingView

The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.

TextFormatters

Assigns the list of text formatters. If the provided list is not null, it sets the list. Otherwise, it assigns the default text formatters retrieved from the data source. To configure the existing Mentions look and feel check out CometChatMentionsFormatter

Header View

You can set the Custom Header view to add more options to the Conversations component. The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.

DatePattern

You can modify the date pattern to your requirement using DatePattern. datePattern formats date and time values according to a predefined standard, enhancing consistency and clarity in their presentation. Shown below is the default chat interface.
The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.
DatePatterns describes a specific format or arrangement used to represent dates in a human-readable form.

TitleView

The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.

SubtitleView

You can customize the subtitle view for each conversation item to meet your requirements. Shown below is the default chat interface.
The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.

Options

A function that returns a list of actions available when hovering over a conversation item. Shown below is the default chat interface.
The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.

Structure of CometChatOption