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

# User Member Wrapper

> User Member Wrapper — CometChat documentation.

## Overview

The `UserMemberWrapper` component is an intuitive interface that presents a list of users or group members according to the chat context. by default it shows the list of users.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/2SVOPiSpm0QEqRoz/images/edb6d7e4-user_member_wrapper_overview_web_screens-b909422509fa288a52a46a2712a45763.png?fit=max&auto=format&n=2SVOPiSpm0QEqRoz&q=85&s=e000478ec7c45d99029a117daa3bc357" width="3600" height="2400" data-path="images/edb6d7e4-user_member_wrapper_overview_web_screens-b909422509fa288a52a46a2712a45763.png" />
</Frame>

## Usage

### Integration

The following code snippet illustrates how you can directly incorporate the CometChatUserMemberWrapper component into your app.

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

    @NgModule({
      imports: [BrowserModule, CometChatUserMemberWrapper],
      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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      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-user-member-wrapper
        [userMemberListType]="userMemberListType"
      ></cometchat-user-member-wrapper>
    </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. onItemClick

`onItemClick` is triggered when you click on a ListItem of UserMemberWrapper component. You can override this action using the following code snippet.

<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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      public handleOnItemClick = (userMember: CometChat.User | CometChat.GroupMember) => {
        console.log("your custom on item click 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-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [onItemClick]="handleOnItemClick"
      ></cometchat-user-member-wrapper>
    </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 UserMemberWrapper 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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      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-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [onError]="handleOnError"
      ></cometchat-user-member-wrapper>
    </div>
    ```
  </Tab>
</Tabs>

***

##### 3. onEmpty

This action allows you to specify a callback function to be executed when a certain condition, typically the absence of data or content, is met within the component or element.

<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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      public handleOnEmpty = () =>{
        console.log("your custom on empty 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-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [onEmpty]="handleOnEmpty"
      ></cometchat-user-member-wrapper>
    </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.

You can set `usersRequestBuilder`and `groupMemberRequestBuilder` in the UserMemberWrapper Component to filter the list. You can modify the builder as per your specific requirements with multiple options available to know more refer to [UsersRequestBuilder](/sdk/javascript/retrieve-users) and [GroupMemberRequestBuilder](/sdk/javascript/retrieve-group-members)

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/FGBCGWXGo5d9bVxR/images/c45861d4-user_member_wrapper_filter_web_screens-be197d0ab403ecad267a8c1dc872cf75.png?fit=max&auto=format&n=FGBCGWXGo5d9bVxR&q=85&s=dd9b20fc073ea75c2f764156aba94694" width="3600" height="2400" data-path="images/c45861d4-user_member_wrapper_filter_web_screens-be197d0ab403ecad267a8c1dc872cf75.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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      usersRequestBuilder = new CometChat.UsersRequestBuilder().setLimit(2)
      groupMemberRequestBuilder = new CometChat.GroupMembersRequestBuilder('guid').setLimit(2)
      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-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [usersRequestBuilder]="usersRequestBuilder"
        [groupMemberRequestBuilder]="groupMemberRequestBuilder"
      ></cometchat-user-member-wrapper>
    </div>
    ```
  </Tab>
</Tabs>

***

### 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 `CometChatUserMemberWrapper` component does not produce any events.

## Customization

To fit your app's design requirements, you can customize the appearance of the `UserMemberWrapper` 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. Avatar Style

If you want to apply customized styles to the `Avatar` component within the `UserMemberWrapper` Component, you can use the following code snippet. For more information you can refer [Avatar Styles](/ui-kit/angular/avatar#avatar-style).

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/19qJLi95IaEk2j9s/images/fc8e074c-user_member_wrapper_avatar_style_web_screens-ccef01d7d29b8792bd15536a2ca9239a.png?fit=max&auto=format&n=19qJLi95IaEk2j9s&q=85&s=851da1421f04d40929168ed9687d6753" width="3600" height="2400" data-path="images/fc8e074c-user_member_wrapper_avatar_style_web_screens-ccef01d7d29b8792bd15536a2ca9239a.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, AvatarStyle } from '@cometchat/chat-uikit-angular';
    import { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      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">
      <cometchat-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [avatarStyle]="avatarStyle"
      ></cometchat-user-member-wrapper>
    </div>
    ```
  </Tab>
</Tabs>

***

##### 2. StatusIndicator Style

To apply customized styles to the Status Indicator component in the `UserMemberWrapper` Component, you can use the following code snippet. For further insights on Status Indicator Styles [refer](/ui-kit/angular/status-indicator)

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/OOBJyP9hM0C-rAe_/images/dde4336d-user_member_wrapper_status_indicator_style_web_screens-72948f236fef940fde1221dc579799b6.png?fit=max&auto=format&n=OOBJyP9hM0C-rAe_&q=85&s=72470bfef68c93635e2a7cddf7377c64" width="3600" height="2400" data-path="images/dde4336d-user_member_wrapper_status_indicator_style_web_screens-72948f236fef940fde1221dc579799b6.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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      statusIndicatorStyle: any = ({
        height: '15px',
        width: '15px',
        backgroundColor: 'green'
      });
      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-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [statusIndicatorStyle]="statusIndicatorStyle"
      ></cometchat-user-member-wrapper>
    </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.

<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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      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-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [disableUsersPresence]="true"
      ></cometchat-user-member-wrapper>
    </div>
    ```
  </Tab>
</Tabs>

below is a list of customizations along with corresponding code snippets

Below is a customizations list along with corresponding code snippets

| Property                                                          | Description                                                                                                                                                                                                 | Code                                              |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| **userMemberListType**                                            | specifies whether the member list should display group members or individual users.                                                                                                                         | `[userMemberListType]="userMemberListType"`       |
| **searchKeyword** <Tooltip tip="Not available">🛑</Tooltip>       | allows users to filter and display only those items in a list that match the provided keyword.                                                                                                              | `[searchKeyword]="'custom searchkeyword'"`        |
| **disableLoadingState** <Tooltip tip="Not available">🛑</Tooltip> | disable the loading state                                                                                                                                                                                   | `[disableLoadingState]="true"`                    |
| **disableUsersPresence**                                          | used to control visibility of status indicator shown if user is online                                                                                                                                      | `[disableUsersPresence]="true"`                   |
| **userPresencePlacement**                                         | determines the position where the user presence indicator is displayed relative to the user's avatar or name, with `right` or `bottom` indicating it's displayed to the right or bottom of the user's list. | `[userPresencePlacement]="userPresencePlacement"` |
| **hideSeparator**                                                 | When set to true, hides the separator between the individual elements in the list.                                                                                                                          | `[hideSeparator]="true"`                          |
| **loadingIconUrl**                                                | used to set the custom loading icon                                                                                                                                                                         | `[loadingIconUrl]="'custom loading url'"`         |

***

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

With the listItemVIew property, you can assign a custom ListItem to the UserMemberWrapper Component.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-rn-guide-message-privately/PrOf0fpV33FkfOMB/images/16af738d-user_member_wrapper_advance_web_screens-195a385f2ba71494ceeba5b99f8312fb.png?fit=max&auto=format&n=PrOf0fpV33FkfOMB&q=85&s=046ea4bdd36439d824eea2c1886df382" width="3600" height="2400" data-path="images/16af738d-user_member_wrapper_advance_web_screens-195a385f2ba71494ceeba5b99f8312fb.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 { UserMemberListType } from '@cometchat/uikit-resources';
    import "@cometchat/uikit-elements";

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

      constructor(private themeService:CometChatThemeService) {
        themeService.theme.palette.setMode("light")
        themeService.theme.palette.setPrimary({ light: "#6851D6", dark: "#6851D6" })
      }
      userMemberListType = UserMemberListType.users;
      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-user-member-wrapper
        [userMemberListType]="userMemberListType"
        [listItemView]="listItemView"
      ></cometchat-user-member-wrapper>
    </div>
    <ng-template #listItemView let-item>
      <div>{{item.getName()}}</div>
    </ng-template>
    ```
  </Tab>
</Tabs>

***
