Skip to main content
The Conversation List + Message View layout offers a seamless two-panel chat interface, commonly used in modern messaging applications like WhatsApp Web, Slack, and Microsoft Teams. This design enables users to switch between conversations effortlessly while keeping the chat window open, ensuring a smooth, real-time messaging experience.

User Interface Overview

This layout is structured into three key sections:
  1. Sidebar (Conversation List) – Displays active conversations, including users and groups.
  2. Message View – Shows chat messages for the selected conversation in real-time.
  3. Message Composer – Provides an input field for typing and sending messages, along with support for media, emojis, and reactions.

Step-by-Step Guide

Step 1: Create Sidebar

Let’s create the Sidebar component which will render different conversations.

Folder Structure

Create a CometChatSelector folder inside your src/app directory and add the following files:

Download the Icon

These icons are available in the CometChat UI Kit assets folder. You can find them at:
🔗 GitHub Assets Folder
CometChatSelector.tsx

Step 2: Render Experience

Now we will create the CometChatNoSSR.tsx & CometChatNoSSR.css files. Here, we will initialize the CometChat UI Kit, log in a user, and build the messaging experience using CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer components.
CometChatNoSSR.tsx

Step 3: Disable SSR and Render the CometChat Component

Create a file CometChat.tsx inside the routes folder:
Now, create a route for CometChat in your routes file:
Why disable SSR? CometChat UI Kit Builder relies on browser APIs such as window, document, and WebSockets. Since React Router renders on the server by default, disabling SSR for this component prevents runtime errors.

Step 4: Update App CSS

Next, add the following styles to app.css to ensure CometChat UI Kit is properly styled.
app.css

Step 5: Run Your Application

  1. Start the development server
  2. Verify the chat interface
  • In your browser, navigate to the /chat route (e.g., http://localhost:3000/chat).
  • Confirm that the chat experience loads as expected.

Next Steps

Enhance the User Experience