Skip to main content
This guide builds a two-panel chat layout — conversation list on the left, messages on the right. Users tap a conversation to open it. This assumes you’ve already completed Next.js Integration (project created, UI Kit installed, CSS imported).
Fork the sandbox, insert your CometChat credentials (App ID, Region, Auth Key), and preview the UI in real time.

What You’re Building

Three sections working together:
  1. Sidebar (conversation list) — shows all active conversations (users and groups)
  2. Message view — displays chat messages for the selected conversation in real time
  3. Message composer — text input with support for media, emojis, and reactions

Step 1 — Create the Sidebar Component

src
app
CometChatSelector
CometChatSelector.tsx
CometChatSelector.css
CometChatSelector.tsx

Step 2 — Create the CometChatNoSSR Component

This component handles init, login, and renders the full chat experience. It runs client-side only.
src
app
CometChatNoSSR
CometChatNoSSR.tsx
CometChatNoSSR.css
CometChatNoSSR.tsx

Step 3 — Disable SSR in Your Page

Dynamically import CometChatNoSSR with ssr: false so it only loads client-side.
index.tsx
CometChat depends on browser APIs (window, WebSocket, document). Setting ssr: false ensures the component only renders on the client, avoiding hydration errors.

Step 4 — Run the Project

You should see the conversation list on the left. Tap any conversation to load messages on the right.

Next Steps

Theming

Customize colors, fonts, and styles to match your brand

Components Overview

Browse all prebuilt UI components
Next.js

Next.js Integration

Back to the main setup guide

Core Features

Chat features included out of the box