Tip: You can fork the sandbox, insert your CometChat credentials (App ID, Region, Auth Key.) in the code, and immediately preview how the UI and messages respond in real time.
User Interface Preview

- Sidebar (Conversation List) – Displays recent conversations with active users and groups.
- Message View – Shows the selected chat with real-time messages.
- Message Input Box – Allows users to send messages seamlessly.
Step-by-Step Guide
Step 1: Create a Tab Component
To manage navigation, let’s build aCometChatTabs
component. This component will render different tabs and allow switching between sections dynamically.
Folder Structure
Create aCometChatTabs
folder inside your src
directory and add the following files:
Download the Icons
These icons are available in the CometChat UI Kit assets folder. You can find them at:🔗 GitHub Assets Folder
Implementation
CometChatTabs.tsx
Step 2: Create Sidebar
Let’s create theSidebar
component which will render different conversations.
Folder Structure
Create aCometChatSelector
folder inside your src/app
directory and add the following files:
CometChatSelector.tsx
Step 3: Render Experience
Now we will update theCometChatNoSSR.tsx
& CometChatNoSSR.css
files to import these new components as below,
CometChatNoSSR.tsx
Step 4: Disabling SSR for CometChatNoSSR.tsx
in Next.js
In this update, we will disable Server-Side Rendering (SSR) for CometChatNoSSR.tsx
while keeping the rest of the application’s SSR functionality intact. This ensures that the CometChat UI Kit components load only on the client-side, preventing SSR-related issues.
Disabling SSR in index.tsx
Modify your index.tsx
file to dynamically import the CometChatNoSSR.tsx
component with { ssr: false }
.
index.tsx
Why disable SSR?
- The CometChat UI Kit depends on browser APIs (window, document, WebSockets).
- Next.js pre-renders components on the server, which can cause errors with browser-specific features.
- By setting
{ ssr: false }
, we ensure that CometChatNoSSR.tsx only loads on the client.
Step 5: Update Global CSS
Next, add the following styles to global.css to ensure CometChat UI Kit is properly styled.global.css
Step 6: Run the project
Next Steps
Enhance the User Experience
- Advanced Customizations – Personalize the chat UI to align with your brand.