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

# Add Members

> Add Members — CometChat documentation.

## Overview

`CometChatAddMembers` is a [Component](/ui-kit/react-native/v4/components-overview#components) that allows administrators or group owners to add new members to a specific group. It enables administrators or group owners to extend the membership of a group by adding new users to participate in the group's discussions and activities. By utilising this feature, administrators can manage group membership, and control access to group content. The administrator can select the desired users to be added to the group. This can be done by searching for specific users, selecting from a list of available users. The selected users will receive notifications to join the group.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/7u2IVu2u8EK1e2Ep/images/82d5af44-add_members_overview_cometchat_screens-a742294340c995f13644143abba57bfe.png?fit=max&auto=format&n=7u2IVu2u8EK1e2Ep&q=85&s=0745313ab806edb980c5612dcbdf7af3" alt="Image" width="4498" height="3120" data-path="images/82d5af44-add_members_overview_cometchat_screens-a742294340c995f13644143abba57bfe.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/kibZL8uJM6A1yelM/images/263c24b3-add_members_overview_cometchat_screens-d24bdfb8b6e7395c1850ee17936992cd.png?fit=max&auto=format&n=kibZL8uJM6A1yelM&q=85&s=39d0d23feecb56c9fea980d211b9da21" alt="Image" width="4498" height="3120" data-path="images/263c24b3-add_members_overview_cometchat_screens-d24bdfb8b6e7395c1850ee17936992cd.png" />
  </Tab>
</Tabs>

***

## Usage

### Integration

The following code snippet illustrates how you can directly incorporate the Add Members component into your Application.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      return (
        <>{group && <CometChatAddMembers group={group}></CometChatAddMembers>}</>
      );
    }
    ```
  </Tab>
</Tabs>

***

### Actions

[Actions](/ui-kit/react-native/v4/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. onSelection

The `onSelection` action is activated when you select the done icon while in selection mode. This returns a list of all the users that you have selected.

This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const onSelectionHandler = (list: CometChat.User[]) => {
        //code
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              onSelection={onSelectionHandler}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 2. OnBack

`OnBack` is triggered when you click on the back button of the Add Members component. You can override this action using the following code snippet.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const onBackHandler = () => {
        //code
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              onBack={onBackHandler}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 3. onError

This action doesn't change the behavior of the component but rather listens for any errors that occur in the Add Membets component.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const onErrorHandler = (error: CometChat.CometChatException) => {
        //code
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              onError={onErrorHandler}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </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.

##### 1. UsersRequestBuilder

The [UsersRequestBuilder](/sdk/react-native/retrieve-users) enables you to filter and customize the users list based on available parameters in UsersRequestBuilder. This feature allows you to create more specific and targeted queries when fetching users. The following are the parameters available in [UsersRequestBuilder](/sdk/react-native/retrieve-users)

| Methods              | Type           | Description                                                                            |
| -------------------- | -------------- | -------------------------------------------------------------------------------------- |
| **setLimit**         | number         | sets the number users that can be fetched in a single request, suitable for pagination |
| **setSearchKeyword** | string         | used for fetching users matching the passed string                                     |
| **hideBlockedUsers** | boolean        | used for fetching all those users who are not blocked by the logged in user            |
| **friendsOnly**      | boolean        | used for fetching only those users in which logged in user is a member                 |
| **setRoles**         | Array\<string> | used for fetching users containing the passed tags                                     |
| **setTags**          | Array\<string> | used for fetching users containing the passed tags                                     |
| **withTags**         | boolean        | used for fetching users containing tags                                                |
| **setStatus**        | string         | used for fetching users by their status online or offline                              |
| **setUIDs**          | Array\<string> | used for fetching users containing the passed users                                    |

**Example**

In the example below, we are applying a filter to the UserList by setting the limit to four and sorting the lists by their name.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const usersRequestBuilder = new CometChat.UsersRequestBuilder()
        .setLimit(4)
        .sortBy("name");

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              usersRequestBuilder={usersRequestBuilder}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 2. SearchRequestBuilder

The SearchRequestBuilder uses [UserRequestBuilder](/sdk/react-native/retrieve-users) enables you to filter and customize the search list based on available parameters in UserRequestBuilder.

**Example**

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const searchRequestBuilder = new CometChat.UsersRequestBuilder()
        .setLimit(100)
        .setSearchKeyword("Alice");

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              searchRequestBuilder={searchRequestBuilder}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

### Events

[Events](/ui-kit/react-native/v4/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.

Events emitted by the Add Members component is as follows.

| Event                  | Description                                        |
| ---------------------- | -------------------------------------------------- |
| **ccGroupMemberAdded** | Triggers when a user added to a group successfully |

<Tabs>
  <Tab title="Adding Listeners">
    ```tsx theme={null}
    import { CometChatUIEventHandler } from "@cometchat/chat-uikit-react-native";

    CometChatUIEventHandler.addGroupListener("GROUP_LISTENER_ID", {
      ccGroupMemberAdded: ({ message }: { message: CometChat.BaseMessage }) => {
        //code
      },
    });
    ```
  </Tab>
</Tabs>

***

<Tabs>
  <Tab title="Removing Listeners">
    ```tsx theme={null}
    import { CometChatUIEventHandler } from "@cometchat/chat-uikit-react-native";

    CometChatUIEventHandler.removeGroupListener("GROUP_LISTENER_ID");
    ```
  </Tab>
</Tabs>

***

## Customization

To fit your app's design requirements, you can customize the appearance of the Add Members 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

To apply customized styles to the `Avatar` component in the Add Members Component, you can use the following code snippet. For further insights on `Avatar` Styles [refer](/ui-kit/react-native/v4/avatar)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatAddMembers,
      BorderStyleInterface,
      AvatarStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const borderStyle: BorderStyleInterface = {
        borderWidth: 1,
        borderStyle: "solid",
        borderColor: "red",
      };

      const avatarStyle: AvatarStyleInterface = {
        outerViewSpacing: 5,
        outerView: {
          borderWidth: 2,
          borderStyle: "dotted",
          borderColor: "blue",
        },
        border: borderStyle,
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              avatarStyle={avatarStyle}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 2. LisItem Style

To apply customized styles to the `ListItemStyle` component in the `Add Members` Component, you can use the following code snippet. For further insights on `ListItemStyle` Styles [refer](/ui-kit/react-native/v4/list-item)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatAddMembers,
      ListItemStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const listItemStyle: ListItemStyleInterface = {
        titleColor: "red",
        backgroundColor: "#d2cafa",
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              listItemStyle={listItemStyle}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 3. StatusIndicator Style

To apply customized styles to the Status Indicator component in the Add Members Component, You can use the following code snippet. For further insights on Status Indicator Styles [refer](/ui-kit/react-native/v4/status-indicator)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatAddMembers,
      StatusIndicatorStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const statusIndicatorStyle: StatusIndicatorStyleInterface = {
        backgroundColor: "grey",
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              statusIndicatorStyle={statusIndicatorStyle}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </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.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              title="Custom Title"
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/5senUb2cWrSVWw7I/images/0d76c3ad-add_members_func_cometchat_screens-cc1142b0bc4adbe32bf62a7d06da2c1d.png?fit=max&auto=format&n=5senUb2cWrSVWw7I&q=85&s=620b8eb82f26e06eb87ade9d4d7ef93e" alt="Image" width="4498" height="3120" data-path="images/0d76c3ad-add_members_func_cometchat_screens-cc1142b0bc4adbe32bf62a7d06da2c1d.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/S4pTPhXdmnpWJLIt/images/2c7d4b07-add_members_func_cometchat_screens-b5ff2cfd286172ccf949dc0fc6bd657e.png?fit=max&auto=format&n=S4pTPhXdmnpWJLIt&q=85&s=a0874d39bc645f6751a5850bb58d2d76" alt="Image" width="4498" height="3120" data-path="images/2c7d4b07-add_members_func_cometchat_screens-b5ff2cfd286172ccf949dc0fc6bd657e.png" />
  </Tab>
</Tabs>

Below is a list of customizations along with corresponding code snippets

| Property                                            | Description                                                                             | Code                              |
| --------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------- |
| **title**                                           | Used to set title in the app bar                                                        | `title?: string;`                 |
| **searchPlaceholderText**                           | Used to set search placeholder text                                                     | `searchPlaceholderText?: string;` |
| **backButtonIcon**                                  | Used to set back button icon                                                            | `backButtonIcon?: ImageURISource` |
| **showBackButton**                                  | Used to toggle visibility for back button                                               | `showBackButton?: boolean`        |
| **searchBoxIcon**                                   | Used to set search Icon in the search field                                             | `searchBoxIcon?: ImageURISource`  |
| **hideSearch**                                      | Used to toggle visibility for search box                                                | `hideSearch?: boolean`            |
| **hideError**                                       | Used to hide error on fetching users                                                    | `hideError?: boolean`             |
| **hideSeparator**                                   | Used to hide the divider separating the user items                                      | `hideSeparator?: boolean`         |
| **disableUsersPresence**                            | Used to control visibility of user indicator shown if user is online                    | `disableUsersPresence?: boolean`  |
| **selectionIcon**                                   | Used to override the default selection complete icon                                    | `selectionIcon?: ImageURISource`  |
| **emptyStateText**                                  | Used to set a custom text response when fetching the users has returned an empty list   | `emptyStateText?: string`         |
| **errorStateText**                                  | Used to set a custom text response when some error occurs on fetching the list of users | `errorStateText?: string`         |
| **group** <Tooltip tip="Not available">🛑</Tooltip> | Used to pass group object of which group members will be shown                          | `group={chatGroup}`               |

***

### Advance

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 this property, you can assign a custom ListItem to the Add Members Component.

**Example**

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/5senUb2cWrSVWw7I/images/09c01136-add_members_list_item_view_cometchat_screens-0e16e88215ebc9cc0b675102b31e7c7d.png?fit=max&auto=format&n=5senUb2cWrSVWw7I&q=85&s=ef0374f7be0220ca8e05e7ffe0186863" alt="Image" width="4498" height="3120" data-path="images/09c01136-add_members_list_item_view_cometchat_screens-0e16e88215ebc9cc0b675102b31e7c7d.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/0zf0AzyXRy6UbTAi/images/e8744bd8-add_members_list_item_view_cometchat_screens-92a875b6fae1a84a4ce7ce08cdf5dfbf.png?fit=max&auto=format&n=0zf0AzyXRy6UbTAi&q=85&s=de256b602ffb1d5f5a97d881d54a9c63" alt="Image" width="4498" height="3120" data-path="images/e8744bd8-add_members_list_item_view_cometchat_screens-92a875b6fae1a84a4ce7ce08cdf5dfbf.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const viewStyle: StyleProp<ViewStyle> = {
        flex: 1,
        flexDirection: "row",
        alignItems: "flex-start",
        padding: 10,
        borderColor: "black",
        borderWidth: 1,
        backgroundColor: "#E8EAE9",
        borderRadius: 10,
        margin: 2,
      };

      const getListItemView = (info: { item: CometChat.User; index: number }) => {
        let user = info.item;
        return (
          <View style={viewStyle}>
            <CometChatAvatar
              image={user.getAvatar() ? { uri: user.getAvatar() } : undefined}
              name={user.getName()}
            />

            <View>
              <Text style={{ color: "black", fontWeight: "bold" }}>
                {user.getName()}
              </Text>
              <Text style={{ color: "#667" }}>{user.getStatus()}</Text>
            </View>
          </View>
        );
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              title="Custom Title"
              ListItemView={getListItemView}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

#### SubtitleView

You can customize the subtitle view for each users to meet your requirements

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/B3XaZtq031kOZfI6/images/d6d0f297-add_members_subtitle_view_cometchat_screens-54d0a21d24f9be07be1168a915a2a46d.png?fit=max&auto=format&n=B3XaZtq031kOZfI6&q=85&s=ad446f82a0c46ae17cbe27561e8dd2c0" alt="Image" width="4498" height="3120" data-path="images/d6d0f297-add_members_subtitle_view_cometchat_screens-54d0a21d24f9be07be1168a915a2a46d.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/qwv2C0wM1Djl_VYB/images/f94dda35-add_members_subtitle_view_cometchat_screens-2efd4bff69a52583f0e820ecee28a721.png?fit=max&auto=format&n=qwv2C0wM1Djl_VYB&q=85&s=fed8bad8d80086cd5b24287f1f66f1ee" alt="Image" width="4498" height="3120" data-path="images/f94dda35-add_members_subtitle_view_cometchat_screens-2efd4bff69a52583f0e820ecee28a721.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const getSubtitleView = (user) => {
        return (
          <Text
            style={{
              fontSize: 12,
              color: theme.palette.getAccent800(),
            }}
          >
            Last Active At:{" "}
            {user?.lastActiveAt ? formatTime(user?.lastActiveAt) : "--"}
          </Text>
        );
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              title="Custom Title"
              SubtitleView={getSubtitleView}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

#### LoadingStateView

You can set a custom loader view using `LoadingStateView` to match the loading view of your app.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/P-fnFPeZIhsNyk74/images/c1022554-add_members_loading_state_view_cometchat_screens-4881a2d6e79ff00f5394c5908ba994ef.png?fit=max&auto=format&n=P-fnFPeZIhsNyk74&q=85&s=aae7ded9c8cb589a9731d06e272d63f7" alt="Image" width="4498" height="3120" data-path="images/c1022554-add_members_loading_state_view_cometchat_screens-4881a2d6e79ff00f5394c5908ba994ef.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/P-fnFPeZIhsNyk74/images/be19c455-add_members_loading_state_view_cometchat_screens-1f53d51e4cc4483be943556fbb584c44.png?fit=max&auto=format&n=P-fnFPeZIhsNyk74&q=85&s=3adb603ca1de18c55ff958009e0fe2cd" alt="Image" width="4498" height="3120" data-path="images/be19c455-add_members_loading_state_view_cometchat_screens-1f53d51e4cc4483be943556fbb584c44.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const loadingViewStyle: StyleProp<ViewStyle> = {
        flex: 1,
        alignItems: "center",
        justifyContent: "center",
        padding: 10,
        borderColor: "black",
        borderWidth: 1,
        backgroundColor: "#E8EAE9",
      };

      const getLoadingStateView = () => {
        return (
          <View style={loadingViewStyle}>
            <Text style={{ fontSize: 20, color: "black" }}>Loading...</Text>
          </View>
        );
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              LoadingStateView={getLoadingStateView}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

#### EmptyStateView

You can set a custom `EmptyStateView` using `EmptyStateView` to match the empty view of your app.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/B3XaZtq031kOZfI6/images/d16c95ac-add_members_empty_state_view_cometchat_screens-bbfdceaa8906c28ff3bbb295c7f810bc.png?fit=max&auto=format&n=B3XaZtq031kOZfI6&q=85&s=c71cc7419250673382588487614a2702" alt="Image" width="4498" height="3120" data-path="images/d16c95ac-add_members_empty_state_view_cometchat_screens-bbfdceaa8906c28ff3bbb295c7f810bc.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/2xNny9K-x0AIgQXg/images/330dbacb-add_members_empty_state_view_cometchat_screens-5485e9434262db7ce11f3483f1b41f4c.png?fit=max&auto=format&n=2xNny9K-x0AIgQXg&q=85&s=eb30131cd87516f5807b38bba781bab0" alt="Image" width="4498" height="3120" data-path="images/330dbacb-add_members_empty_state_view_cometchat_screens-5485e9434262db7ce11f3483f1b41f4c.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const searchRequestBuilder = new CometChat.UsersRequestBuilder()
        .setLimit(100)
        .setSearchKeyword("does-not-exist");

      const emptyViewStyle: StyleProp<ViewStyle> = {
        flex: 1,
        alignItems: "center",
        justifyContent: "center",
        padding: 10,
        borderColor: "black",
        borderWidth: 1,
        backgroundColor: "#E8EAE9",
      };

      const getEmptyStateView = () => {
        return (
          <View style={emptyViewStyle}>
            <Text style={{ fontSize: 80, color: "black" }}>Empty</Text>
          </View>
        );
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              searchRequestBuilder={searchRequestBuilder}
              EmptyStateView={getEmptyStateView}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

#### AppBarOptions

You can set the Custom Menu view to add more options to the Add Members component.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/P-fnFPeZIhsNyk74/images/bf12d5df-add_members_app_bar_options_cometchat_screens-c97a18a2cec21f52e695ca32c314309d.png?fit=max&auto=format&n=P-fnFPeZIhsNyk74&q=85&s=3c92fcd78e8b9c82167e396828379670" alt="Image" width="4498" height="3120" data-path="images/bf12d5df-add_members_app_bar_options_cometchat_screens-c97a18a2cec21f52e695ca32c314309d.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/TK46Vd2P-QKxY1cn/images/df9154f3-add_members_app_bar_options_cometchat_screens-8e462a37b8851f00e2cf504c0f80ad98.png?fit=max&auto=format&n=TK46Vd2P-QKxY1cn&q=85&s=320cba96e0ce5323a449bb71ef498232" alt="Image" width="4498" height="3120" data-path="images/df9154f3-add_members_app_bar_options_cometchat_screens-8e462a37b8851f00e2cf504c0f80ad98.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const getAppBarOptions = () => {
        return (
          <TouchableOpacity
            style={styles.button}
            onPress={() => {
              /*code*/
            }}
          >
            <Image source={Notification} style={styles.image} />
          </TouchableOpacity>
        );
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              AppBarOptions={getAppBarOptions}
              selectionMode="none"
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

#### Swipe Options

You can set the Custom Swipe options to the Add Members component.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/SIU3NLl8GrgWvCMj/images/49e575bd-add_members_options_cometchat_screens-e0b3a50d8ebf0e5c2a876ff92eb0e75a.png?fit=max&auto=format&n=SIU3NLl8GrgWvCMj&q=85&s=e65850f01f8ec1cc70f7846978d8bf5b" alt="Image" width="4498" height="3120" data-path="images/49e575bd-add_members_options_cometchat_screens-e0b3a50d8ebf0e5c2a876ff92eb0e75a.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b-docs-audit-content-webhooks/tnx7dFNyijg-6-_e/images/52a71de1-add_members_options_cometchat_screens-3293ef41e68cefc53512eca96965306d.png?fit=max&auto=format&n=tnx7dFNyijg-6-_e&q=85&s=93bf8f2816cfd6e198a92c1a5bc6d9bc" alt="Image" width="4498" height="3120" data-path="images/52a71de1-add_members_options_cometchat_screens-3293ef41e68cefc53512eca96965306d.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatAddMembers } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const getCustomOptions = (user: CometChat.User) => {
        const customOption: CometChatOptions = {
          id: "custom id",
          title: "Call",
          icon: Call,
          iconTint: "#7316f5",
          backgroundColor: "#93f5bf",
          onPress: () => console.log("custom action"),
        };

        return [customOption];
      };

      return (
        <>
          {group && (
            <CometChatAddMembers
              group={group}
              options={getCustomOptions}
            ></CometChatAddMembers>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***
