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

# 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-rn-guide-message-privately/Xgdtn9VZPDi47bm-/images/266153bd-1623200308-ca857d0227c7929eda2b89b2e438c8a6.png?fit=max&auto=format&n=Xgdtn9VZPDi47bm-&q=85&s=3d9c6c02c0ee489624c1d2bb95c5c66d" 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-rn-guide-message-privately/ugckbRl5Q-H7t8X2/images/e322f386-1623200314-7662892bd89a6f083322968ecbed9c69.png?fit=max&auto=format&n=ugckbRl5Q-H7t8X2&q=85&s=5ed9ae3ea05fa68a71b8f8597e92f7e2" 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-rn-guide-message-privately/fxK75AS6FzDL1Oqo/images/b8504c0c-1623200318-80f65cbfd0439329203f1e755b20d4f0.png?fit=max&auto=format&n=fxK75AS6FzDL1Oqo&q=85&s=4f151d4b171a42b330e956c48dc20384" 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-rn-guide-message-privately/xIG5VBdyNJ5cYSqE/images/d0aaa28f-1623200326-242a5109fb3680df642f1f6863b1a989.png?fit=max&auto=format&n=xIG5VBdyNJ5cYSqE&q=85&s=f59b637ed58d6af22000452625cacb60" 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-rn-guide-message-privately/FGBCGWXGo5d9bVxR/images/bd3a2501-1623200332-6d14ccaa981b89c48bd161f2406fe5ba.png?fit=max&auto=format&n=FGBCGWXGo5d9bVxR&q=85&s=9c15385b989d87c7b35eb60170bcad0c" 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-rn-guide-message-privately/TO10Bmu50bb5qPTI/images/3012726f-1623200335-bdbb36ffd74b786cd59683b3f16b5569.png?fit=max&auto=format&n=TO10Bmu50bb5qPTI&q=85&s=d67ba2d46b08f1762ec73582836d6b1b" 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-rn-guide-message-privately/JSRiWiPGBHsJZFCg/images/9e550801-1623200339-b375d34dcf9aa8142dccb7f315235540.png?fit=max&auto=format&n=JSRiWiPGBHsJZFCg&q=85&s=6749080d22e899c2cfd8d0e940b72c58" 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>
