Skip to main content
This guide builds a tabbed messaging UI — Chats, Calls, Users, and Groups tabs in the sidebar, with a message view on the right. Good for full-featured apps that need more than just conversations. This assumes you’ve already completed React Router Integration (project created, UI Kit installed, CSS imported).

What You’re Building

Three sections working together:
  1. Tab bar — switches between Chats, Calls, Users, and Groups
  2. Sidebar — renders the list for the active tab
  3. Message view — header + messages + composer for the selected item

Step 1 — Create the Tab Component

src
app
CometChatTabs
CometChatTabs.tsx
CometChatTabs.css
Tab icons need to be placed in public/assets/. Download them from the CometChat UI Kit assets folder on GitHub.
public
assets
chats.svg
calls.svg
users.svg
groups.svg
CometChatTabs.tsx

Step 2 — Create the Sidebar Component

The sidebar renders the list for whichever tab is active, plus the tab bar at the bottom.
src
app
CometChatSelector
CometChatSelector.tsx
CometChatSelector.css
CometChatSelector.tsx

Step 3 — Create the CometChatNoSSR Component

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

Step 4 — Disable SSR and Add the Route

Create CometChat.tsx inside the routes folder. This uses lazy loading and a mounted check to ensure CometChat only runs client-side.
routes/CometChat.tsx
Add the route to your routes config:
routes.ts
CometChat depends on browser APIs (window, WebSocket, document). The lazy import + mounted check ensures the component only renders on the client.

Step 5 — Run the Project

Navigate to /chat (e.g. http://localhost:5173/chat). You should see the tab bar at the bottom of the sidebar. Switch between Chats, Calls, Users, and Groups — tapping any item loads the message view on the right.

Next Steps

Theming

Customize colors, fonts, and styles to match your brand

Components Overview

Browse all prebuilt UI components

React Router Integration

Back to the main setup guide

Core Features

Chat features included out of the box