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:
| Components | Description |
|---|---|
| ListItem Component | 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
- app.module.ts
- app.component.ts
- app.component.html
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.
- app.component.ts
- app.component.html
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.
- app.component.ts
- app.component.html
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
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. MessageHeader Style
To customize the appearance, you can assign aMessageHeaderStyle object to the MessageHeader component.
Example
In this example, we are employing the MessageHeaderStyle.
- app.component.ts
- app.component.html
MessageHeaderStyle are as follows:
| Property | Description | Code |
|---|---|---|
| border | Used to set border | border?: string, |
| borderRadius | Used to set border radius | borderRadius?: string; |
| background | Used to set background colour | background?: string; |
| height | Used to set height | height?: string; |
| width | Used to set width | width?: string; |
| backButtonIconTint | Used to set back button icon tint | backButtonIconTint?: string; |
| typingIndicatorTextFont | Used to set typing indicator textStyle | typingIndicatorTextFont?: string; |
| typingIndicatorTextColor | Used to set typing indicator text color | typingIndicatorTextColor?: string; |
| subtitleTextFont | Used to set subtitle text font style | subtitleTextFont?: string; |
| subtitleTextColor | Used to set subtitle text color | subtitleTextColor?: string; |
| onlineStatusColor | Used to set online status colour | onlineStatusColor?: string; |
| privateGroupIconBackground | Used to set private groups icon backgound | privateGroupIconBackground?: string |
| passwordGroupIconBackground | Used to set protected groups icon backgound | passwordGroupIconBackground?: string |
2. Avatar Style
If you want to apply customized styles to theAvatar component within the MessageHeader Component, you can use the following code snippet. For more information you can refer Avatar Styles.
- app.component.ts
- app.component.html
3. ListItem Style
If you want to apply customized styles to theList Item component within the MessageHeader Component, you can use the following code snippet. For more information, you can refer ListItem Styles.
- app.component.ts
- app.component.html
4. StatusIndicator Style
If you want to apply customized styles to theStatus Indicator component within the MessageHeader Component, you can use the following code snippet. For more information you can refer StatusIndicator Styles.
- app.component.ts
- app.component.html
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.- app.component.ts
- app.component.html
| Property | Description | Code |
|---|---|---|
| user | Used to pass user object of which header specific details will be shown | [user]="userObject" |
| group | Used to pass group object of which header specific details will be shown | [group]="groupObject" |
| passwordGroupIcon | Used to set custom protected group icon | passwordGroupIcon="your custom private group icon url" |
| privateGroupIcon | Used to set custom private group icon | privateGroupIcon="your custom protected group icon url" |
| hideBackButton | Used to toggle back button visibility | hideBackButton=true |
| disableTyping | Used to enable disable typing indicators | disableTyping=true |
| disableUsersPresence | Used to toggle functionality to show user’s presence | disableUsersPresence=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.ListItemView
TheMessageHeader component consists of a listItemView. You can customize the ListItem according to your requirements by using the listItemView property.
Example

- app.component.ts
- app.component.html
SubtitleView
By using thesubtitleView property, you can modify the SubtitleView to meet your specific needs.
Example

- app.component.ts
- app.component.html
BackButtonIconURL
You can customize the Back Icon according to your specific requirements by using thebackButtonIconURL property.
Example

- app.component.ts
- app.component.html
Menu
You can customize the Menu options to meet your specific needs by using themenu property.
Example

- app.component.ts
- app.component.html