> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-feature-react-thread-subscription-pin-sa.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-feature-react-thread-subscription-pin-sa/TbaebRaLSarxLk9L/images/266153bd-1623200308-ca857d0227c7929eda2b89b2e438c8a6.png?fit=max&auto=format&n=TbaebRaLSarxLk9L&q=85&s=eebb7f59cace09f84265007831a79760" 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-feature-react-thread-subscription-pin-sa/GGWDv6Os92L9c0Vg/images/e322f386-1623200314-7662892bd89a6f083322968ecbed9c69.png?fit=max&auto=format&n=GGWDv6Os92L9c0Vg&q=85&s=d708e970f02342f55bd54d70c346e03c" 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-feature-react-thread-subscription-pin-sa/IO-HQZNniup1Acvz/images/b8504c0c-1623200318-80f65cbfd0439329203f1e755b20d4f0.png?fit=max&auto=format&n=IO-HQZNniup1Acvz&q=85&s=9757a58967ff898eb0f3eb696c229c53" 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-feature-react-thread-subscription-pin-sa/w6tQ6znCeyLHSc0D/images/d0aaa28f-1623200326-242a5109fb3680df642f1f6863b1a989.png?fit=max&auto=format&n=w6tQ6znCeyLHSc0D&q=85&s=743375f0a23d04453f540b065005913a" 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-feature-react-thread-subscription-pin-sa/epK3wdJomqP7pb0B/images/bd3a2501-1623200332-6d14ccaa981b89c48bd161f2406fe5ba.png?fit=max&auto=format&n=epK3wdJomqP7pb0B&q=85&s=63730a99a6749f6b899dc0950d8849f7" 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-feature-react-thread-subscription-pin-sa/15QQvQFwC79oSXnR/images/3012726f-1623200335-bdbb36ffd74b786cd59683b3f16b5569.png?fit=max&auto=format&n=15QQvQFwC79oSXnR&q=85&s=9bafe2fd756d0580a2b6e0ad5f1de367" 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-feature-react-thread-subscription-pin-sa/AE3L4DF0VD6MyMqf/images/9e550801-1623200339-b375d34dcf9aa8142dccb7f315235540.png?fit=max&auto=format&n=AE3L4DF0VD6MyMqf&q=85&s=e48520712079bbb3e5f8dae61603e50a" 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>
