Skip to main content
FieldValue
Package@cometchat/chat-uikit-react
FrameworkReact.js
ComponentsCometChatConversations, CometChatCallLogs, CometChatUsers, CometChatGroups, CometChatMessageHeader, CometChatMessageList, CometChatMessageComposer
LayoutTabbed sidebar (Chats, Calls, Users, Groups) + message view
PrerequisiteComplete React.js Integration Steps 1–5 first
PatternFull-featured messaging app with multiple sections
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.js Integration (project created, UI Kit installed, init + login working, 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. Tab bar — switches between Chats, Calls, Users, and Groups
  2. Sidebar — renders the list for the active tab (conversations, call logs, users, or groups)
  3. Message view — header + messages + composer for the selected item

Step 1 — Create the Tab Component

Create a CometChatTabs folder inside src/:
src
CometChatTabs
assets
chats.svg
calls.svg
users.svg
groups.svg
CometChatTabs.tsx
CometChatTabs.css
Download the tab icons from the CometChat UI Kit assets folder on GitHub.
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
CometChatSelector
CometChatSelector.tsx
CometChatSelector.css
CometChatSelector.tsx
Key points:
  • The activeTab state drives which list component renders — CometChatConversations, CometChatCallLogs, CometChatUsers, or CometChatGroups.
  • Each list component passes its selection back to the parent via onSelectorItemClicked with a type string so the parent knows what was selected.
  • CometChatTabs renders at the bottom of the sidebar.

Step 3 — Update App.tsx and App.css

Wire everything together. The app handles selections from any tab — conversations, users, groups, or calls.
App.tsx
How it works:
  • Selections from any tab (Chats, Calls, Users, Groups) flow through the same onSelectorItemClicked callback.
  • Conversation items are unwrapped via getConversationWith() to extract the underlying User or Group.
  • Call selections are tracked separately in selectedCall — add your own call details UI as needed.
  • Only one of selectedUser / selectedGroup / selectedCall is set at a time — the others are cleared.

Step 4 — Run the Project

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.js Integration

Back to the main setup guide

Core Features

Chat features included out of the box