> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-mintlify-715169f7.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-mintlify-715169f7/klPuF6mA1HMHdx3G/images/266153bd-1623200308-ca857d0227c7929eda2b89b2e438c8a6.png?fit=max&auto=format&n=klPuF6mA1HMHdx3G&q=85&s=a41d6679c2bef1a776b476620d7257b2" 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-mintlify-715169f7/zxyu46NTRXGxCr8i/images/e322f386-1623200314-7662892bd89a6f083322968ecbed9c69.png?fit=max&auto=format&n=zxyu46NTRXGxCr8i&q=85&s=7d6034699c6f952de33b38e2a64cfda2" 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-mintlify-715169f7/zqfskHrqw9gnaCrA/images/b8504c0c-1623200318-80f65cbfd0439329203f1e755b20d4f0.png?fit=max&auto=format&n=zqfskHrqw9gnaCrA&q=85&s=c26421bd9966c428107b558f22330c17" 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-mintlify-715169f7/cRx68hKSYWgpHc5c/images/d0aaa28f-1623200326-242a5109fb3680df642f1f6863b1a989.png?fit=max&auto=format&n=cRx68hKSYWgpHc5c&q=85&s=ce9687c574758abc03c6ccb8f709d7dc" 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-mintlify-715169f7/3Sz_vUuHlib7otOg/images/bd3a2501-1623200332-6d14ccaa981b89c48bd161f2406fe5ba.png?fit=max&auto=format&n=3Sz_vUuHlib7otOg&q=85&s=9c19957a824dccf9b1f8d94bfbd5deb7" 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-mintlify-715169f7/ceK6M7l4RL_K53nk/images/3012726f-1623200335-bdbb36ffd74b786cd59683b3f16b5569.png?fit=max&auto=format&n=ceK6M7l4RL_K53nk&q=85&s=e17624575e192e4f25667ddc8176b2cd" 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-mintlify-715169f7/v5dqFuMIk9LJXhE9/images/9e550801-1623200339-b375d34dcf9aa8142dccb7f315235540.png?fit=max&auto=format&n=v5dqFuMIk9LJXhE9&q=85&s=312111bda30d0b3f90d47f7bed9dda85" 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>
