CometChatDetails is a component that provides additional information and settings related to a specific user.The details screen includes the following elements and functionalities:
User Information: It displays details about the user. This includes his/her profile picture, name, status, and other relevant information.
User Actions: The details screen provides actions to block/unblock the user.
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. onBack
The onBack event is typically triggered when the back button is clicked and it does not carry a default action.With the following code snippet, you can effortlessly override this default operation.
Filters allow you to customize the data displayed in a list within a Component. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK.CometChatDetails component does not have available filters.
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.The list of User Related Events emitted by the Details component is as follows:
Event
Description
ccUserBlocked
This event is triggered when the user successfully blocks another user.
ccUserUnblocked
This event is triggered when the user successfully unblocks another user.
To fit your app’s design requirements, you can customize the appearance of the details component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.
Using Style you can customize the look and feel of the component in your app, These parameters typically control elements such as the color, size, shape, and fonts used within the component.
1. Details Style
You can set the DetailsStyle to the User Details Component to customize the styling.
Used to customise the font of the title in the app bar
titleFont?: FontStyleInterface;
titleColor
Used to customise the color of the title in the app bar
titleColor?: string;
backIconTint
Sets the color of the back icon of the component
backIconTint?: string;
closeIconTint
Sets the color of the close icon of the component
closeIconTint?: string;
onlineStatusColor
Sets the color of the status indicator representing the user’s online status
onlineStatusColor?: string;
2. StatusIndicator Style
To apply customized styles to the StatusIndicator component in the Details Component, you can use the following code snippet. For further insights on StatusIndicator Styles refer
To apply customized styles to the List Item component in the Details Component, you can use the following code snippet. For further insights on List Item Styles refer
To apply customized styles to the Avatar component in the Conversations Component, you can use the following code snippet. For further insights on Avatar Styles refer
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.
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.
The CometChatDetailsTemplate offers a structure for organizing information in the CometChat details component. It serves as a blueprint, defining how user-related details are presented. This structure allows for customization and organization within the CometChat interface.This defines the structure of template data for the details component.
Name
Type
Description
id
string | number
Identifier for the template option
title
string
Heading text for the template option
titleColor
string
User-defined UI component to customise the trailing view for each option in a template.
titleFont
FontStyleInterface
User-defined UI component to override the default view for the option.
titleStyle
TextStyle
Function invoked when user clicks on the option.
sectionSeparatorColor
string
Sets all the different properties of font for the title text
The DetailsOption defines the structure for individual options within the CometChat details component, facilitating customization and functionality for user interactions.This defines the structure of each option for a template in the details component.
Property
Type
Description
id
string | number
Identifier for the template
title
string
Heading text for the template
titleStyle
TextStyle
Sets the title style
icon
ImageType
Sets all the different properties of font for the title text
iconTint
string
Sets the icon tint`
backgroundColor
string
Sets the background color
CustomView
() => JSX.Element
Sets custom view for the option
Tail
() => JSX.Element
Sets the tail view for the option
height
number
Sets the height
onClick
({ user, group }: { user?: any; group?: any }) => void;
Sets the onClick Handler for the option
Below is an example of using Custom Details templates: