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

# UI Components

> UI Components — CometChat documentation.

**UI Components** are building blocks of the UI Kit. **UI Components** are a set of custom classes specially designed to build a rich chat app. There are different UI Components available in the UI Kit Library.

### CometChatUI

**CometChatUI** is an option to launch a fully functional chat application using the UI Kit. In **CometChatUI** all the **UI Components** are interlinked and work together to launch a fully functional chat on your website/application.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-multi-attachment-react-uikit-v7/DBep6P1toI7iS0Dd/images/266153bd-1623200308-ca857d0227c7929eda2b89b2e438c8a6.png?fit=max&auto=format&n=DBep6P1toI7iS0Dd&q=85&s=d44c179ca429d076356069f0541b0317" width="2514" height="1180" data-path="images/266153bd-1623200308-ca857d0227c7929eda2b89b2e438c8a6.png" />
</Frame>

<Tabs>
  <Tab title="React">
    ```js theme={null}

    import {CometChatUI} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatUI chatWithGroup="cometchat-guid-1" />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>

It takes the following properties:

| Parameter     | Description                                                                                                                          | Type     |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------- |
| chatWithUser  | The ID of the user you want to chat with                                                                                             | Optional |
| chatWithGroup | The ID of the group you want to chat with                                                                                            | Optional |
| friendsOnly   | Value could be *true* or *false* This property when set to true will return only the friends of the logged-in user in the users tab. | Optional |

<Warning>
  *friendsOnly* prop is deprecated from version **v2.3.5-1** . Please use **userListMode** variable of UIKitSettings class for displaying only friends in the user list. Please refer to this link for documentation: [Customize UI Kit](/ui-kit/react/v2/customize-ui-kit)
</Warning>

### CometChatUserListWithMessages

The `CometChatUserListWithMessages` is a component with a list of users. The component has all the necessary listeners and methods required to display the user's list and shows the set of the messages/chats of the selected user.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-multi-attachment-react-uikit-v7/XVBsbk0wsPW52Oj_/images/e322f386-1623200314-7662892bd89a6f083322968ecbed9c69.png?fit=max&auto=format&n=XVBsbk0wsPW52Oj_&q=85&s=6550b651c8aab9be9f6b131afffddd27" width="1440" height="900" data-path="images/e322f386-1623200314-7662892bd89a6f083322968ecbed9c69.png" />
</Frame>

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import {CometChatUserListWithMessages} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatUserListWithMessages chatWithUser="cometchat-uid-5" />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>

It takes the following properties:

| Parameter    | Description                                                                                                         | Type     |
| ------------ | ------------------------------------------------------------------------------------------------------------------- | -------- |
| chatWithUser | The ID of the user you want to chat with                                                                            | Optional |
| friendsOnly  | Value could be *true* or *false* This property when set to true will return only the friends of the logged-in user. | Optional |

<Warning>
  *friendsOnly* prop is deprecated from version **v2.3.5-1**. Please use **userListMode** variable of UIKitSettings class for displaying only friends in the user list. Please refer to this link for documentation: [Customize UI Kit](/ui-kit/react/v2/customize-ui-kit)
</Warning>

### CometChatGroupListWithMessages

The `CometChatGroupListWithMessages` is a component with a list of groups. The component has all the necessary listeners and methods required to display the group's list and shows the set of the messages/chats of the selected group.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-multi-attachment-react-uikit-v7/aB79XMJS4cnarUFm/images/b8504c0c-1623200318-80f65cbfd0439329203f1e755b20d4f0.png?fit=max&auto=format&n=aB79XMJS4cnarUFm&q=85&s=78e1616d7ba066daa1b10d87ef06df22" width="1440" height="900" data-path="images/b8504c0c-1623200318-80f65cbfd0439329203f1e755b20d4f0.png" />
</Frame>

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import {CometChatGroupListWithMessages} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatGroupListWithMessages chatWithGroup="cometchat-guid-1" />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>

It takes the following properties:

| Parameter     | Description                               | Type     |
| ------------- | ----------------------------------------- | -------- |
| chatWithGroup | The ID of the group you want to chat with | Optional |

### CometChatConversationListWithMessages

The `CometChatConversationListWithMessages` is a component with a list of recent conversations. The component has all the necessary listeners and methods required to display the recent conversation list and shows the set of the messages/chats of the selected recent conversation

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-multi-attachment-react-uikit-v7/czoZwjOJmBSfpcZm/images/d0aaa28f-1623200326-242a5109fb3680df642f1f6863b1a989.png?fit=max&auto=format&n=czoZwjOJmBSfpcZm&q=85&s=e5b2492088beabdd095a3af5f01dc399" width="1440" height="900" data-path="images/d0aaa28f-1623200326-242a5109fb3680df642f1f6863b1a989.png" />
</Frame>

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import {CometChatConversationListWithMessages} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatConversationListWithMessages  />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>

It takes the following properties:

| Parameter     | Description                               | Type     |
| ------------- | ----------------------------------------- | -------- |
| chatWithUser  | The ID of the user you want to chat with  | Optional |
| chatWithGroup | The ID of the group you want to chat with | Optional |

### CometChatMessages

The `CometChatMessages` is a component that displays the list of messages for a particular user or group.

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import {CometChatMessages} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatMessages chatWithGroup="cometchat-guid-1" />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>

It takes the following properties:

| Parameter     | Description                               | Type     |
| ------------- | ----------------------------------------- | -------- |
| chatWithUser  | The ID of the user you want to chat with  | Required |
| chatWithGroup | The ID of the group you want to chat with | Optional |

### CometChatUserList

The `CometChatUserList` is a component that displays the list of users available to chat. You can use this component within your app if you wish to display the list of users.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-multi-attachment-react-uikit-v7/HsUS3u4OkbwX4f06/images/bd3a2501-1623200332-6d14ccaa981b89c48bd161f2406fe5ba.png?fit=max&auto=format&n=HsUS3u4OkbwX4f06&q=85&s=0c0bb4f55c78d4c9b1e1d5d59ece886b" width="1440" height="900" data-path="images/bd3a2501-1623200332-6d14ccaa981b89c48bd161f2406fe5ba.png" />
</Frame>

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import {CometChatUserList} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatUserList friendsOnly={true} />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>

It takes the following props:

| Parameter   | Description                                                                                                         | Type     |
| ----------- | ------------------------------------------------------------------------------------------------------------------- | -------- |
| friendsOnly | Value could be *true* or *false* This property when set to true will return only the friends of the logged-in user. | Optional |

<Warning>
  *friendsOnly* prop is deprecated from version **v2.3.5-1**. Please use **userListMode** variable of UIKitSettings class for displaying only friends in the user list. Please refer to this link for documentation: [Customize UI Kit](/ui-kit/react/v2/customize-ui-kit)
</Warning>

### CometChatGroupList

The `CometChatGroupList` is a component that displays the list of groups available. You can use this component within your app if you wish to display the list of groups.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-multi-attachment-react-uikit-v7/3AkQrT_c23-X3KkU/images/3012726f-1623200335-bdbb36ffd74b786cd59683b3f16b5569.png?fit=max&auto=format&n=3AkQrT_c23-X3KkU&q=85&s=75126d194107ea87d662eb914853d19f" width="1440" height="900" data-path="images/3012726f-1623200335-bdbb36ffd74b786cd59683b3f16b5569.png" />
</Frame>

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import {CometChatGroupList} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatGroupList />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>

### CometChatConversationList

You can use the `CometChatConversationList` component to display the list of recent conversations that the logged-in user was a part of.

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-multi-attachment-react-uikit-v7/W4Tvpi2Blqycs9QT/images/9e550801-1623200339-b375d34dcf9aa8142dccb7f315235540.png?fit=max&auto=format&n=W4Tvpi2Blqycs9QT&q=85&s=bea3cea0d99a07fa11539942312f52af" width="1440" height="900" data-path="images/9e550801-1623200339-b375d34dcf9aa8142dccb7f315235540.png" />
</Frame>

<Tabs>
  <Tab title="React">
    ```js theme={null}
    import {CometChatConversationList} from "./cometchat-pro-react-ui-kit/CometChatWorkspace/src";

    class App extends React.Component {
      
      render() {
        
         return (
           <div style={{width: '800px', height:'800px' }}>
            <CometChatConversationList />
           </div>
        );
      }
      
    }
    ```
  </Tab>
</Tabs>
