> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-react-ui-kit-plugin-precedence.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-react-ui-kit-plugin-precedence/-P53ucb_s0unoRtu/images/266153bd-1623200308-ca857d0227c7929eda2b89b2e438c8a6.png?fit=max&auto=format&n=-P53ucb_s0unoRtu&q=85&s=7955942954843bfbea74e8b441a5ee04" 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 **v3.0.0-beta5-1**. Please use **userListMode** variable\
  [Customize UI Kit](/ui-kit/react/v3/customize)
</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-react-ui-kit-plugin-precedence/1QGcg8JbIJ8TfffW/images/e322f386-1623200314-7662892bd89a6f083322968ecbed9c69.png?fit=max&auto=format&n=1QGcg8JbIJ8TfffW&q=85&s=cfd387da8b5cd991d81fbe1496158273" 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 **v3.0.0-beta5-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/v3/customize)
</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-react-ui-kit-plugin-precedence/pzMhcgXTBRRhFTux/images/b8504c0c-1623200318-80f65cbfd0439329203f1e755b20d4f0.png?fit=max&auto=format&n=pzMhcgXTBRRhFTux&q=85&s=d9d26842c7daf54e7309d202bb4a93fa" 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-react-ui-kit-plugin-precedence/tF3hpSo81dER2qtk/images/d0aaa28f-1623200326-242a5109fb3680df642f1f6863b1a989.png?fit=max&auto=format&n=tF3hpSo81dER2qtk&q=85&s=1f1c10c6d72cfc4ea68c54cff7929dcb" 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-react-ui-kit-plugin-precedence/2Mrt0f0oLTPYi26E/images/bd3a2501-1623200332-6d14ccaa981b89c48bd161f2406fe5ba.png?fit=max&auto=format&n=2Mrt0f0oLTPYi26E&q=85&s=08574018c5b796a1d64d5dd27d5e6c29" 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 **v3.0.0-beta5-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/v3/customize)
</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-react-ui-kit-plugin-precedence/OgmRwQ5VZGy8ZBnL/images/3012726f-1623200335-bdbb36ffd74b786cd59683b3f16b5569.png?fit=max&auto=format&n=OgmRwQ5VZGy8ZBnL&q=85&s=bbdde57b7e1a48b3ffcae3cb67d4bfb9" 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-react-ui-kit-plugin-precedence/tszvF3QDuNWVgO3E/images/9e550801-1623200339-b375d34dcf9aa8142dccb7f315235540.png?fit=max&auto=format&n=tszvF3QDuNWVgO3E&q=85&s=29487ffb5aba9b249b1f9986196d8c9b" 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>
