Overview
MessageHeader
is a Component that showcases the User or Group details in the toolbar. Furthermore, it also presents a typing indicator and a back navigation button for ease of use.

MessageHeader
is comprised of the following components:
Component | Description |
---|---|
CometChatListItem | This component’s view consists of avatar, status indicator , title, and subtitle. The fields are then mapped with the SDK’s user, group class. |
Back Button | BackButton that allows users to navigate back from the current activity or screen to the previous one. |
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. OnBack
OnBack
is triggered when you click on the back button of the Message Header component. You can override this action using the following code snippet.
Example
In this example, we are employing the onBack
action.
2. OnError
This action doesn’t change the behavior of the component but rather listens for any errors that occur in the Message Header component. Example In this example, we are employing theonError
action.
Filters
Filters allow you to customize the data displayed in a list within aComponent
. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders
of Chat SDK.
The MessageHeader
component does not have any exposed filters.
Events
Events are emitted by aComponent
. 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 MessageHeader
component does not produce any events.
Customization
To fit your app’s design requirements, you can customize the appearance of the Message Header component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.Style
To customize the appearance, you can customise css ofCometChatMessageHeader
Example

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. Here is a code snippet demonstrating how you can customize the functionality of the Message Header component.Property | Description | Code |
---|---|---|
Show Back Button | Shows the back button in the header in mobile view. | showBackButton={true} |
Hide Video Call Button | Hides the video call button. | hideVideoCallButton={true} |
Hide Voice Call Button | Hides the voice call button. | hideVoiceCallButton={true} |
Show Conversation Summary Button | Hides the conversation summary button. | showConversationSummaryButton={true} |
Hide User Status | Hides the user’s online/offline status indicator. | hideUserStatus={true} |
User | A CometChat.User object representing the user whose information (e.g., status) is displayed. | user={chatUser} |
Group | A CometChat.Group object representing the group whose details (e.g., member count) are displayed. | group={chatGroup} |
Summary Generation Message Count | Number of messages for which the summary should be shown. | summaryGenerationMessageCount={1000} |
Disable Auto Summary Generation | Disables the auto generation of conversation summary. | disableAutoSummaryGeneration={true} |
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
The customized chat interface is displayed below.
TitleView
The customized chat interface is displayed below.
SubtitleView
The customized chat interface is displayed below.
LeadingView
The customized chat interface is displayed below.
TrailingView
The customized chat interface is displayed below.
AuxiliaryButtonView
The customized chat interface is displayed below.