> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Message Header

> Message Header — CometChat documentation.

## Overview

`MessageHeader` is a [Component](/ui-kit/angular/components-overview#components) that showcases the [User](/sdk/javascript/users-overview) or [Group](/sdk/javascript/groups-overview) details in the toolbar. Furthermore, it also presents a typing indicator and a back navigation button for ease of use.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/k0f_g7UwNe_JINeP/images/418bf2aa-messages_header_overview_web_screens-796ab91aaeaf895c3bc142c310b8cf4f.png?fit=max&auto=format&n=k0f_g7UwNe_JINeP&q=85&s=182893449bfbbc39604bfa282e05fb76" width="3600" height="2400" data-path="images/418bf2aa-messages_header_overview_web_screens-796ab91aaeaf895c3bc142c310b8cf4f.png" />
</Frame>

The `MessageHeader` is comprised of the following components:

| Components                                      | Description                                                                                                                                    |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [ListItem Component](/ui-kit/angular/list-item) | 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

<Tabs>
  <Tab title="app.module.ts">
    ```ts theme={null}
    import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from "@angular/core";
    import { BrowserModule } from "@angular/platform-browser";
    import { CometChatMessageHeader } from "@cometchat/chat-uikit-angular";
    import { AppComponent } from "./app.component";

    @NgModule({
      imports: [BrowserModule, CometChatMessageHeader],
      declarations: [AppComponent],
      providers: [],
      bootstrap: [AppComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    })
    export class AppModule {}
    ```
  </Tab>

  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{
      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <cometchat-message-header
        *ngIf="userObject"
        [user]="userObject"
      ></cometchat-message-header>
    </div>
    ```
  </Tab>
</Tabs>

***

### Actions

[Actions](/ui-kit/angular/components-overview#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.

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }

      public handleOnBack = () => {
        console.log("Your custom on back action");
      }

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <cometchat-message-header
        *ngIf="userObject"
        [user]="userObject"
        [onBack]="handleOnBack"
      ></cometchat-message-header>
    </div>
    ```
  </Tab>
</Tabs>

***

##### 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 the `onError` action.

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }

      public handleOnError = (error: CometChat.CometChatException) => {
        console.log("your custom on error action", error);
      };

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <cometchat-message-header
        *ngIf="userObject"
        [user]="userObject"
        [onError]="handleOnError"
      ></cometchat-message-header>
    </div>
    ```
  </Tab>
</Tabs>

***

### Filters

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

The `MessageHeader` component does not have any exposed filters.

### Events

[Events](/ui-kit/angular/components-overview#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 `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 a `MessageHeaderStyle` object to the `MessageHeader` component.

**Example**

In this example, we are employing the `MessageHeaderStyle`.

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import { MessageHeaderStyle } from '@cometchat/uikit-shared';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }

      messageHeaderStyle = new MessageHeaderStyle({
        background:"#f2f3ff",
        border:"2px solid #a117eb",
        borderRadius:"20px",
        subtitleTextColor:"#2d55a6"
      });

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [messageHeaderStyle]="messageHeaderStyle"
        ></cometchat-message-header>
      </div>
    </div>
    ```
  </Tab>
</Tabs>

The properties exposed by `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 the `Avatar` component within the `MessageHeader` Component, you can use the following code snippet. For more information you can refer [Avatar Styles](/ui-kit/angular/avatar#avatar-style).

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit, AvatarStyle } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }

      avatarStyle = new AvatarStyle({
        backgroundColor:"#cdc2ff",
        border:"2px solid #6745ff",
        borderRadius:"10px",
        outerViewBorderColor:"#ca45ff",
        outerViewBorderRadius:"5px",
        nameTextColor:"#4554ff"
      });

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [avatarStyle]="avatarStyle"
        ></cometchat-message-header>
      </div>
    </div>
    ```
  </Tab>
</Tabs>

***

##### 3. ListItem Style

If you want to apply customized styles to the `List Item` component within the `MessageHeader` Component, you can use the following code snippet. For more information, you can refer [ListItem Styles](/ui-kit/angular/list-item#listitemstyle).

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit, ListItemStyle } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }

      listItemStyle: ListItemStyle = new ListItemStyle({
          background: "transparent",
          padding:"20px",
          border:"1px solid #e9b8f5",
          titleColor:"#8830f2",
          borderRadius:"20px"
      });

      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [listItemStyle]="listItemStyle"
        ></cometchat-message-header>
      </div>
    </div>
    ```
  </Tab>
</Tabs>

***

##### 4. StatusIndicator Style

If you want to apply customized styles to the `Status Indicator` component within the `MessageHeader` Component, you can use the following code snippet. For more information you can refer [StatusIndicator Styles](/ui-kit/angular/status-indicator).

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      statusIndicatorStyle: any = ({
        height: '20px',
        width: '20px',
        backgroundColor: 'red'
      });
      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [statusIndicatorStyle]="statusIndicatorStyle"
        ></cometchat-message-header>
      </div>
    </div>
    ```
  </Tab>
</Tabs>

***

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

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      hideBackButton = true;
      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [hideBackButton]="hideBackButton"
        ></cometchat-message-header>
      </div>
    </div>
    ```
  </Tab>
</Tabs>

Following is a list of customizations along with their corresponding code snippets:

| Property                                            | Description                                                              | Code                                                      |
| --------------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------- |
| **user** <Tooltip tip="Not available">🛑</Tooltip>  | Used to pass user object of which header specific details will be shown  | `[user]="userObject"`                                     |
| **group** <Tooltip tip="Not available">🛑</Tooltip> | 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

The `MessageHeader` component consists of a `listItemView`. You can customize the ListItem according to your requirements by using the `listItemView` property.

**Example**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/NN4EdpOU3viwWMb_/images/0f2944a8-messages_header_list_item_view_web_screens-0ddf7be639dd5ba1db4156bf81d1a22e.png?fit=max&auto=format&n=NN4EdpOU3viwWMb_&q=85&s=c5df5fb37e458d534ee7939c7bd3b367" width="3600" height="2400" data-path="images/0f2944a8-messages_header_list_item_view_web_screens-0ddf7be639dd5ba1db4156bf81d1a22e.png" />
</Frame>

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit, ListItemStyle, AvatarStyle } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      listItemStyle: ListItemStyle = new ListItemStyle({
        background: "transparent",
        padding:"5px",
        border:"1px solid #e9b8f5",
        titleColor:"#8830f2",
        borderRadius:"20px",
        width:"100% !important"
      });
      avatarStyle = new AvatarStyle({
        backgroundColor:"#cdc2ff",
        border:"2px solid #6745ff",
        borderRadius:"10px",
        outerViewBorderColor:"#ca45ff",
        outerViewBorderRadius:"5px",
        nameTextColor:"#4554ff"
      });
      hideSeparator = true;
      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [listItemView]="listItemViewTemplate"
        ></cometchat-message-header>
      </div>
    </div>

    <ng-template #listItemViewTemplate>
      <cometchat-list-item
        [ngStyle]="{width:'100%'}"
        [avatarURL]="userObject.getAvatar()"
        [title]="userObject.getName()"
        [hideSeparator]="hideSeparator"
        [avatarStyle]="avatarStyle"
        [listItemStyle]="listItemStyle"
      ></cometchat-list-item>
    </ng-template>
    ```
  </Tab>
</Tabs>

***

#### SubtitleView

By using the `subtitleView` property, you can modify the SubtitleView to meet your specific needs.

**Example**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/FGBCGWXGo5d9bVxR/images/c46b8048-messages_header_subtitle_view_web_screens-08b5c79e8d7704e2174054668f4d584c.png?fit=max&auto=format&n=FGBCGWXGo5d9bVxR&q=85&s=819d45b85c487706ac143968c6acbb22" width="3600" height="2400" data-path="images/c46b8048-messages_header_subtitle_view_web_screens-08b5c79e8d7704e2174054668f4d584c.png" />
</Frame>

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [subtitleView]="subtitleView"
        ></cometchat-message-header>
      </div>
    </div>

    <ng-template #subtitleView>
      <div style="color: #db35de; font-size: 15px;">{{userObject.getStatus()}}</div>
    </ng-template>
    ```
  </Tab>
</Tabs>

***

#### BackButtonIconURL

You can customize the Back Icon according to your specific requirements by using the `backButtonIconURL` property.

**Example**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/OOBJyP9hM0C-rAe_/images/da5a11a4-messages_header_back_icon_url_web_screens-225dc4d7cf64bfac3c92646c0ef01c29.png?fit=max&auto=format&n=OOBJyP9hM0C-rAe_&q=85&s=67b549355a14e1820084d615f0e17ab8" width="3600" height="2400" data-path="images/da5a11a4-messages_header_back_icon_url_web_screens-225dc4d7cf64bfac3c92646c0ef01c29.png" />
</Frame>

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;
      BackButtonIconURL = 'your custom back icon url';
      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [backButtonIconURL]="backButtonIconURL"
        ></cometchat-message-header>
      </div>
    </div>
    ```
  </Tab>
</Tabs>

***

#### Menu

You can customize the Menu options to meet your specific needs by using the `menu` property.

**Example**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/_MYSdWhXnUkTkjEH/images/4f64fcdb-messages_header_menu_web_screens-5b3bc1c5a826f1daa44b5e8ba35d4a1b.png?fit=max&auto=format&n=_MYSdWhXnUkTkjEH&q=85&s=3d4df1c8fea3854cd28814eca5a57a5b" width="3600" height="2400" data-path="images/4f64fcdb-messages_header_menu_web_screens-5b3bc1c5a826f1daa44b5e8ba35d4a1b.png" />
</Frame>

<Tabs>
  <Tab title="app.component.ts">
    ```ts theme={null}
    import { CometChat } from '@cometchat/chat-sdk-javascript';
    import { Component, OnInit } from '@angular/core';
    import {  CometChatThemeService, CometChatUIKit } from '@cometchat/chat-uikit-angular';
    import "@cometchat/uikit-elements";

    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent implements OnInit{

      ngOnInit(): void {
        CometChat.getUser("uid").then((user:CometChat.User)=>{
          this.userObject=user;
        });
      }

      public userObject!: CometChat.User;
      BackButtonIconURL = 'your custom back icon url';
      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      handleReload(): void {
        window.location.reload();
      };

      getButtonStyle() {
        return {
          height: '20px',
          width: '20px',
          border: 'none',
          borderRadius: '0',
          background: 'transparent'
        };
      };
      getButtonIconStyle() {
        return {
          color: '#7E57C2'
        };
      };
      onLogin(UID?: any) {
        CometChatUIKit.login({ uid: UID }).then(
          (user) => {
            setTimeout(() => {
              window.location.reload();
            }, 1000);
          },
          (error) => {
            console.log("Login failed with exception:", { error });
          }
        );
      }
    }
    ```
  </Tab>

  <Tab title="app.component.html">
    ```html theme={null}
    <div class="fullwidth">
      <div style="height: 100px;width: 100%;">
        <cometchat-message-header
          *ngIf="userObject"
          [user]="userObject"
          [menu]="buttonTemplate"
        ></cometchat-message-header>
      </div>
    </div>

    <ng-template #buttonTemplate>
      <div style="margin-right: 20px;">
        <button [ngStyle]="getButtonStyle()" (click)="handleReload()">
          <img src="icon" [ngStyle]="getButtonIconStyle()" alt="Reload Icon" />
        </button>
      </div>
    </ng-template>
    ```
  </Tab>
</Tabs>

***
