+
+ );
}
```
-
-
-
-**How it works**:
-- Init and login happen inside `useEffect` — the component only renders chat UI after login resolves.
-- When a conversation is tapped, the `User` or `Group` is extracted from the `Conversation` object.
-- `selectedUser` / `selectedGroup` state drives which chat is displayed — pass either `user` or `group` to the message components, never both.
-
+```astro title="src/pages/chat.astro"
---
-
-## Step 2 — Render the Astro Page
-
-Import the island and hydrate it client-side using `client:only="react"`.
-
-```astro title="src/pages/index.astro" lines
----
-import ChatApp from "../components/ChatApp.tsx";
-import "../styles/globals.css";
+import ConversationChat from '../components/ConversationChat.tsx';
---
- CometChat + Astro
+
+ Chat
-
-
+
+
```
-The `client:only="react"` directive ensures the component skips SSR entirely and only renders in the browser — required because CometChat needs `window` and `WebSocket`.
+---
+
+## How It Works
+
+1. **`client:only="react"`** tells Astro to skip server-rendering and hydrate the component entirely on the client. This is required because CometChat uses browser APIs.
+2. **React island** — the CometChat UI lives in a self-contained React component. Astro handles the page shell, React handles the interactive chat.
+3. **CometChatProvider** wraps the entire tree — it supplies theme, locale, and event context to all CometChat components.
+4. **CometChatConversations** renders the sidebar list. When a user clicks a conversation, `onItemClick` fires with the `Conversation` object.
+5. **handleConversationClick** extracts the `User` or `Group` from the conversation and stores it in state.
+6. **Message components** (`MessageHeader`, `MessageList`, `MessageComposer`) receive either `user` or `group` as a prop — never both at the same time.
---
-## Step 3 — Run the Project
+## Run
-
-
-```bash lines
+```bash
npm run dev
```
-
-
-```bash lines
-pnpm dev
-```
-
-
-```bash lines
-yarn dev
-```
-
-
-You should see the conversation list on the left. Tap any conversation to load messages on the right.
+Open `http://localhost:4321/chat`. You should see the conversation list on the left. Click any conversation to load messages on the right.
---
## Next Steps
-
- Customize colors, fonts, and styles to match your brand
+
+ Single chat window without a sidebar
+
+
+ Tabbed navigation with Chats, Calls, Users
Browse all prebuilt UI components
- } href="/ui-kit/react/astro-integration">
- Back to the main setup guide
-
-
- Chat features included out of the box
+
+ Customize colors, fonts, and styles
diff --git a/ui-kit/react/astro-integration.mdx b/ui-kit/react/astro-integration.mdx
deleted file mode 100644
index df460f8f8..000000000
--- a/ui-kit/react/astro-integration.mdx
+++ /dev/null
@@ -1,329 +0,0 @@
----
-title: "Astro Integration"
-sidebarTitle: "Integration"
-description: "Integrate CometChat React UI Kit with Astro using client-only rendering, app credentials, package setup, initialization, and login."
----
-
-
-
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Peer deps | `react` >=18, `react-dom` >=18, `@astrojs/react` |
-| Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` |
-| Login | `CometChatUIKit.login("UID")` — must resolve before rendering components |
-| Order | `init()` → `login()` → render. Breaking this order = blank screen |
-| Auth Key | Dev/testing only. Use Auth Token in production |
-| SSR | CometChat requires browser APIs — use `client:only="react"` directive on Astro islands |
-| CSS | `import "@cometchat/chat-uikit-react/css-variables.css"` in your React island |
-| Calling | Optional. Install `@cometchat/calls-sdk-javascript` to enable |
-| Other frameworks | [React.js](/ui-kit/react/react-js-integration) · [Next.js](/ui-kit/react/next-js-integration) · [React Router](/ui-kit/react/react-router-integration) |
-| AI Skills | `npx @cometchat/skills add` — [GitHub](https://github.com/cometchat/cometchat-skills) |
-
-
-
-This guide walks you through adding CometChat to an Astro app using React islands. By the end you'll have a working chat UI.
-
-
-CometChat UI Kit requires browser APIs (`window`, `WebSocket`, `document`). In Astro, always load CometChat components using the `client:only="react"` directive so they only render client-side.
-
-
----
-
-## Integrate with AI Coding Agents
-
-Skip the manual steps — use [CometChat Skills](https://github.com/cometchat/cometchat-skills) to integrate via your AI coding agent. Your agent has a short conversation with you to understand your project and chat requirements, then writes production-grade integration code tailored to the files you already have.
-
-```bash
-npx @cometchat/skills add
-```
-
-Use `--ide ` to target a specific IDE (e.g. `--ide cursor`), or `--ide all` for all supported IDEs.
-
-Then in your IDE:
-
-```
-/cometchat add chat to my app
-```
-
-The skill detects Astro, verifies `@astrojs/react` is configured, and reads your routes, nav, and components before proposing a placement. It onboards you to CometChat directly in the terminal — signup, login, and app creation all via the CLI. It shows the plan and waits for your approval before writing code.
-
-After the first integration, re-run `/cometchat` to access the iteration menu: theme presets, 40+ features, component customization, floating widget, production auth, user management, and diagnostics.
-
-Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and [30+ more agents](https://github.com/cometchat/cometchat-skills).
-
----
-
-## Prerequisites
-
-You need three things from the [CometChat Dashboard](https://app.cometchat.com/):
-
-| Credential | Where to find it |
-| --- | --- |
-| App ID | Dashboard → Your App → Credentials |
-| Auth Key | Dashboard → Your App → Credentials |
-| Region | Dashboard → Your App → Credentials (e.g. `us`, `eu`, `in`) |
-
-You also need Node.js (v16+) and npm/yarn installed.
-
-
-Auth Key is for development only. In production, generate Auth Tokens server-side via the [REST API](/rest-api/chat-apis) and use [`loginWithAuthToken()`](/ui-kit/react/methods#login-using-auth-token). Never ship Auth Keys in client code.
-
-
----
-
-## Step 1 — Create an Astro Project
-
-
-
-```bash lines
-npm create astro@latest my-app
-cd my-app
-```
-
-
-```bash lines
-pnpm create astro@latest my-app
-cd my-app
-```
-
-
-```bash lines
-yarn create astro my-app
-cd my-app
-```
-
-
-
----
-
-## Step 2 — Add React and Install the UI Kit
-
-First, add the React integration to Astro:
-
-```bash lines
-npx astro add react
-```
-
-This updates your `astro.config.mjs` automatically. Verify it includes:
-
-```js title="astro.config.mjs" lines
-import { defineConfig } from "astro/config";
-import react from "@astrojs/react";
-
-export default defineConfig({
- integrations: [react()],
-});
-```
-
-Then install the UI Kit:
-
-
-
-```bash lines
-npm install @cometchat/chat-uikit-react
-```
-
-
-```bash lines
-yarn add @cometchat/chat-uikit-react
-```
-
-
-
-This installs the UI Kit and its dependency `@cometchat/chat-sdk-javascript` automatically.
-
-If you want voice/video calling, also install:
-
-```bash lines
-npm install @cometchat/calls-sdk-javascript
-```
-
----
-
-## Step 3 — Initialize CometChat
-
-In Astro, CometChat init and login happen inside your React island component (since they need browser APIs). Here's the pattern:
-
-```tsx lines highlight={7-9}
-import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
-
-/**
- * CometChat Constants - Replace with your actual credentials
- */
-const COMETCHAT_CONSTANTS = {
- APP_ID: "APP_ID", // Replace with your actual App ID from CometChat
- REGION: "REGION", // Replace with your App's Region
- AUTH_KEY: "AUTH_KEY", // Replace with your Auth Key (leave blank if using Auth Token)
-};
-
-const UIKitSettings = new UIKitSettingsBuilder()
- .setAppId(COMETCHAT_CONSTANTS.APP_ID)
- .setRegion(COMETCHAT_CONSTANTS.REGION)
- .setAuthKey(COMETCHAT_CONSTANTS.AUTH_KEY)
- .subscribePresenceForAllUsers()
- .build();
-
-CometChatUIKit.init(UIKitSettings)
- .then(() => {
- console.log("CometChat UI Kit initialized successfully.");
- })
- .catch((error) => {
- console.error("CometChat UI Kit initialization failed:", error);
- });
-```
-
-
-`init()` must resolve before you call `login()`. If you call `login()` before init completes, it will fail silently.
-
-
----
-
-## Step 4 — Login
-
-After init resolves, log the user in. For development, use one of the pre-created test UIDs:
-
-`cometchat-uid-1` · `cometchat-uid-2` · `cometchat-uid-3` · `cometchat-uid-4` · `cometchat-uid-5`
-
-```ts lines highlight={3}
-import { CometChatUIKit } from "@cometchat/chat-uikit-react";
-
-const UID = "UID"; // Replace with your actual UID
-
-CometChatUIKit.getLoggedinUser().then((user) => {
- if (!user) {
- CometChatUIKit.login(UID)
- .then((user) => {
- console.log("Login Successful:", { user });
- // Mount your app
- })
- .catch(console.log);
- } else {
- // Already logged in — mount your app
- }
-});
-```
-
-Key points:
-- `getLoggedinUser()` checks for an existing session so you don't re-login unnecessarily.
-- `login(uid)` skips the API call if a session already exists and returns the cached user.
-- Components must not render until login resolves — use a state flag to gate rendering.
-
-
-For production, use [`loginWithAuthToken()`](/ui-kit/react/methods#login-using-auth-token) instead of Auth Key. Generate tokens server-side via the REST API.
-
-
----
-
-## Step 5 — Add the CSS Import
-
-Import the CometChat CSS inside your React island component:
-
-```tsx lines
-import "@cometchat/chat-uikit-react/css-variables.css";
-```
-
-Also ensure your global CSS sets `height: 100%` on the root elements. Create or update `src/styles/globals.css`:
-
-```css title="src/styles/globals.css" lines
-html,
-body {
- margin: 0;
- padding: 0;
- height: 100%;
-}
-```
-
-Without the CSS import, components will render with broken or missing styles. Without the height rules, the chat UI won't fill the viewport.
-
----
-
-## Step 6 — Choose a Chat Experience
-
-Integrate a conversation view that suits your app's UX. Each option below includes a step-by-step guide.
-
-### Conversation List + Message View
-
-Two-panel layout — conversation list on the left, messages on the right. Think WhatsApp Web or Slack.
-
-- Two-panel layout with conversation list and active chat window
-- Switch between one-to-one and group conversations
-- Tap-to-view on mobile — tapping a conversation opens the message view
-- Real-time updates and message sync across sessions
-
-
-
-
-
-
- Step-by-step guide to build this layout
-
-
----
-
-### One-to-One / Group Chat
-
-Single chat window — no sidebar. Good for support chat, embedded widgets, or focused messaging.
-
-- Dedicated chat window for one-on-one or group messaging
-- No conversation list — users go directly into the chat
-- Full-screen experience optimized for mobile
-- Ideal for support chat or community messaging
-
-
-
-
-
-
- Step-by-step guide to build this layout
-
-
----
-
-### Tab-Based Chat
-
-Tabbed navigation — Chat, Call Logs, Users, Settings in separate tabs. Good for full-featured apps.
-
-- Tab navigation between Chat, Call Logs, Users, and Settings
-- Full-screen messaging within each tab
-- Unified experience for conversations, call history, and settings
-- Scales well for adding future features like notifications or contacts
-
-
-
-
-
-
- Step-by-step guide to build this layout
-
-
----
-
-## Build Your Own Chat Experience
-
-Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.
-
-- [Sample App](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) — Working reference app to compare against
-- [Components](/ui-kit/react/components-overview) — All prebuilt UI elements with props and customization options
-- [Core Features](/ui-kit/react/core-features) — Messaging, real-time updates, and other capabilities
-- [Theming](/ui-kit/react/theme) — Colors, fonts, dark mode, and custom styling
-- [Build Your Own UI](/sdk/javascript/overview) — Skip the UI Kit entirely and build on the raw SDK
-
----
-
-## Next Steps
-
-
-
- Browse all prebuilt UI components
-
-
- Customize colors, fonts, and styles
-
-
- Chat features included out of the box
-
-
- Common issues and fixes
-
-
diff --git a/ui-kit/react/astro-one-to-one-chat.mdx b/ui-kit/react/astro-one-to-one-chat.mdx
index 99d45e160..a3829dc32 100644
--- a/ui-kit/react/astro-one-to-one-chat.mdx
+++ b/ui-kit/react/astro-one-to-one-chat.mdx
@@ -1,7 +1,7 @@
---
title: "One-to-One / Group Chat"
sidebarTitle: "One-to-One / Group Chat"
-description: "Build focused CometChat UI Kit chat screens in Astro with headers, message lists, composers, users, groups, and direct navigation."
+description: "Build a single chat window for one-to-one or group messaging in Astro with CometChat UI Kit."
---
@@ -9,23 +9,24 @@ description: "Build focused CometChat UI Kit chat screens in Astro with headers,
| Field | Value |
| --- | --- |
| Package | `@cometchat/chat-uikit-react` |
-| Framework | Astro (with `@astrojs/react` islands) |
+| Framework | Astro |
| Components | `CometChatMessageHeader`, `CometChatMessageList`, `CometChatMessageComposer` |
| Layout | Single chat window — no sidebar, no conversation list |
-| Prerequisite | Complete [Astro Integration](/ui-kit/react/astro-integration) Steps 1–5 first |
-| SSR | `client:only="react"` directive — CometChat requires browser APIs |
+| Prerequisite | Complete [Astro Integration](/ui-kit/react/integration-astro) first |
+| SSR | React island with `client:only="react"` directive |
| Pattern | Support chat, embedded widgets, focused messaging |
This guide builds a single chat window — no sidebar, no conversation list. Users go directly into a one-to-one or group chat. Good for support chat, embedded widgets, or any focused messaging experience.
-This assumes you've already completed [Astro Integration](/ui-kit/react/astro-integration) (project created, React added, UI Kit installed).
+This assumes you've already completed [Astro Integration](/ui-kit/react/integration-astro) (project created, UI Kit installed, init + login working).
-
+
+
---
## What You're Building
@@ -38,225 +39,159 @@ Three components stacked vertically:
---
-## Step 1 — Create the React Island
-
-Create a `OneToOneChat` component inside `src/components/`. This handles init, login, fetches the target user, and renders the chat UI.
+## Full Code
-
-
-
-
-
-
-
-
+Create a React island component with the chat UI, then render it in an Astro page with `client:only="react"`.
-
-
-
-```tsx title="OneToOneChat.tsx" lines highlight={14-16, 37, 55, 62}
+```tsx title="src/components/DirectChat.tsx"
import { useEffect, useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
import {
- CometChatMessageComposer,
- CometChatMessageHeader,
- CometChatMessageList,
CometChatUIKit,
UIKitSettingsBuilder,
+ CometChatProvider,
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
} from "@cometchat/chat-uikit-react";
-import { CometChat } from "@cometchat/chat-sdk-javascript";
-import "@cometchat/chat-uikit-react/css-variables.css";
-import "./OneToOneChat.css";
-const COMETCHAT_CONSTANTS = {
- APP_ID: "", // Replace with your App ID
- REGION: "", // Replace with your Region
- AUTH_KEY: "", // Replace with your Auth Key (dev only)
-};
+const RECIPIENT_UID = "cometchat-uid-2"; // Replace with the UID you want to chat with
-export default function OneToOneChat() {
- const [user, setUser] = useState(undefined);
- const [selectedUser, setSelectedUser] = useState(undefined);
- const [selectedGroup, setSelectedGroup] = useState(undefined);
+export default function DirectChat() {
+ const [ready, setReady] = useState(false);
+ const [chatUser, setChatUser] = useState(undefined);
useEffect(() => {
- const UIKitSettings = new UIKitSettingsBuilder()
- .setAppId(COMETCHAT_CONSTANTS.APP_ID)
- .setRegion(COMETCHAT_CONSTANTS.REGION)
- .setAuthKey(COMETCHAT_CONSTANTS.AUTH_KEY)
+ const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
.subscribePresenceForAllUsers()
.build();
- CometChatUIKit.init(UIKitSettings)
- .then(() => {
- console.log("Initialization completed successfully");
- CometChatUIKit.getLoggedinUser().then((loggedInUser) => {
- if (!loggedInUser) {
- CometChatUIKit.login("cometchat-uid-2")
- .then((u) => {
- console.log("Login Successful", { u });
- setUser(u);
- })
- .catch((error) => console.error("Login failed", error));
- } else {
- console.log("Already logged-in", { loggedInUser });
- setUser(loggedInUser);
- }
- });
- })
- .catch((error) => console.error("Initialization failed", error));
+ CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ const user = await CometChat.getUser(RECIPIENT_UID);
+ setChatUser(user);
+ setReady(true);
+ });
}, []);
- useEffect(() => {
- if (user) {
- // Fetch the user whose chat you want to load
- const UID = "cometchat-uid-1";
- CometChat.getUser(UID).then(
- (u) => setSelectedUser(u),
- (error) => console.log("User fetching failed with error:", error)
- );
-
- // To load a group chat instead, uncomment below:
- // const GUID = "GUID";
- // CometChat.getGroup(GUID).then(
- // (group) => setSelectedGroup(group),
- // (error) => console.log("Group fetching failed with error:", error)
- // );
- }
- }, [user]);
-
- if (!user) return
- Set a user or group UID in OneToOneChat.tsx to start chatting
-
- )}
- >
+
+
+
+
+
+
+
);
}
```
-
-
-
-```css title="OneToOneChat.css" lines
-.messages-wrapper {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
-}
-
-.empty-conversation {
- height: 100%;
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- background: var(--cometchat-background-color-03, #F5F5F5);
- color: var(--cometchat-text-color-secondary, #727272);
- font: var(--cometchat-font-body-regular, 400 14px Roboto);
-}
+```astro title="src/pages/chat.astro"
+---
+import DirectChat from '../components/DirectChat.tsx';
+---
-.cometchat .cometchat-message-composer {
- border-radius: 0px;
-}
+
+
+
+
+ Chat
+
+
+
+
+
```
-
-
-
Key points:
-- `CometChat.getUser(UID)` fetches the user object from the SDK — you need a real user object, not a manually constructed one.
+- `client:only="react"` ensures the component only runs in the browser — no server-side rendering.
+- `CometChat.getUser(UID)` fetches the full user object from the SDK — you need a real user object, not a manually constructed one.
- Pass either `user` or `group` to the message components, never both.
-- The highlighted lines show where to set your credentials and target UID.
+- The `RECIPIENT_UID` should be a user that exists in your CometChat app. Use one of the pre-created test UIDs: `cometchat-uid-1` through `cometchat-uid-5`.
---
-## Switching Between User and Group Chat
+## Switching to Group Chat
-To load a group chat instead of one-to-one, replace the `getUser` call with `getGroup`:
+To load a group chat instead of one-to-one, fetch a `Group` object and pass it to the message components:
-```tsx lines highlight={1}
-const GUID = "GUID"; // Replace with your actual Group ID
+```tsx title="src/components/DirectChat.tsx"
+import { useEffect, useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatUIKit,
+ UIKitSettingsBuilder,
+ CometChatProvider,
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
+} from "@cometchat/chat-uikit-react";
-CometChat.getGroup(GUID)
- .then((group) => setSelectedGroup(group))
- .catch((error) => console.error("Failed to fetch group:", error));
-```
+const GROUP_ID = "cometchat-guid-1"; // Replace with your Group ID
----
+export default function DirectChat() {
+ const [ready, setReady] = useState(false);
+ const [chatGroup, setChatGroup] = useState(undefined);
-## Step 2 — Render the Astro Page
+ useEffect(() => {
+ const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
+ .subscribePresenceForAllUsers()
+ .build();
-Import the island and hydrate it client-side using `client:only="react"`.
+ CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ const group = await CometChat.getGroup(GROUP_ID);
+ setChatGroup(group);
+ setReady(true);
+ });
+ }, []);
-```astro title="src/pages/index.astro" lines
----
-import OneToOneChat from "../components/OneToOneChat.tsx";
-import "../styles/globals.css";
----
+ if (!ready || !chatGroup) return
- );
- };
-
- return ;
-}
-```
-
-
-```css lines
-.custom-call-log-trailing button {
- background: var(--cometchat-primary-color);
- color: var(--cometchat-static-white);
- border: none;
- border-radius: var(--cometchat-radius-2);
- padding: 4px 12px;
- cursor: pointer;
-}
-```
-
-
-
-### callInitiatedDateTimeFormat
-
-Customize the call initiated timestamp format using a `CalendarObject`.
-
-```tsx lines
-import {
- CometChatCallLogs,
- CalendarObject,
-} from "@cometchat/chat-uikit-react";
-
-function CustomDateCallLogs() {
- const dateFormat = new CalendarObject({
- today: "hh:mm A",
- yesterday: "[yesterday]",
- otherDays: "DD MM YYYY",
- });
-
- return ;
-}
-```
-
-
-If no property is passed in the [CalendarObject](/ui-kit/react/localize#calendarobject), the component checks the [global configuration](/ui-kit/react/localize#customisation) first. If also missing there, the component's default formatting applies.
-
-
----
-
-## Common Patterns
-
-### Custom empty state
-
-```tsx lines
-import { CometChatCallLogs } from "@cometchat/chat-uikit-react";
-
-function EmptyStateCallLogs() {
- return (
-
-
No call history
-
- }
- />
- );
-}
-```
-
-### Filtered to video calls only
-
-```tsx lines
-import { CallLogRequestBuilder } from "@cometchat/calls-sdk-javascript";
-import { CometChatCallLogs } from "@cometchat/chat-uikit-react";
-
-function VideoCallLogs({ authToken }: { authToken: string }) {
- return (
-
- );
-}
-```
-
----
-
-## CSS Architecture
-
-The component uses CSS custom properties (design tokens) defined in `@cometchat/chat-uikit-react/css-variables.css`. The cascade:
-
-1. Global tokens are set on the `.cometchat` root wrapper.
-2. Component CSS (`.cometchat-call-logs`) consumes these tokens via `var()` with fallback values.
-3. Overrides target `.cometchat-call-logs` descendant selectors in a global stylesheet.
-
-### Key Selectors
-
-| Target | Selector |
-| --- | --- |
-| Root | `.cometchat-call-logs` |
-| List item | `.cometchat-call-logs .cometchat-list-item` |
-| Active item | `.cometchat-call-logs__list-item-active .cometchat-list-item` |
-| Trailing view (video) | `.cometchat-call-logs__list-item-trailing-view-video` |
-| Trailing view (audio) | `.cometchat-call-logs__list-item-trailing-view-audio` |
-| Subtitle | `.cometchat-call-logs__list-item-subtitle` |
-| Subtitle date | `.cometchat-call-logs__list-item-subtitle .cometchat-date` |
-| Missed call icon | `.cometchat-call-logs__list-item-subtitle-icon-missed-call` |
-| Outgoing call icon | `.cometchat-call-logs__list-item-subtitle-icon-outgoing-call` |
-| Incoming call icon | `.cometchat-call-logs__list-item-subtitle-icon-incoming-call` |
-| Empty state | `.cometchat-call-logs__empty-state-view` |
-| Error state | `.cometchat-call-logs__error-state-view` |
-| Shimmer loading | `.cometchat-call-logs__shimmer` |
-| Outgoing call overlay | `.cometchat-call-logs__outgoing-call` |
-
-### Customization Matrix
-
-| What to change | Where | Property/API | Example |
-| --- | --- | --- | --- |
-| Override behavior on user interaction | Component props | `on` callbacks | `onItemClick={(c) => showDetails(c)}` |
-| Filter which call logs appear | Component props | `callLogRequestBuilder` | `callLogRequestBuilder={new CallLogRequestBuilder().setLimit(5)}` |
-| Replace a section of the list item | Component props | `View` render props | `subtitleView={(c) =>
{c.getStatus()}
}` |
-| Change colors, fonts, spacing | Global CSS | Target `.cometchat-call-logs` class | `.cometchat-call-logs .cometchat-list-item { background: #f9f8fd; }` |
-
----
-
-## Props
-
-All props are optional.
-
----
-
-### activeCall
-
-Highlights the currently active/selected call log entry.
-
-| | |
-| --- | --- |
-| Type | `any` |
-| Default | `undefined` |
-
----
-
-### callInitiatedDateTimeFormat
-
-Format for displaying the call initiated timestamp.
-
-| | |
-| --- | --- |
-| Type | `CalendarObject` |
-| Default | Component default (`DD MMM, hh:mm A`) |
-
-Falls back to [global calendar configuration](/ui-kit/react/localize#customisation) if not set.
-
----
-
-### callLogRequestBuilder
-
-Controls which call logs load and in what order.
-
-| | |
-| --- | --- |
-| Type | `any` (CallLogRequestBuilder from `@cometchat/calls-sdk-javascript`) |
-| Default | SDK default (30 per page) |
-
----
-
-### emptyView
-
-Custom component displayed when there are no call logs.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in empty state |
-
----
-
-### errorView
-
-Custom component displayed when an error occurs.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in error state |
-
----
-
-### itemView
-
-Custom renderer for the entire call log list item.
-
-| | |
-| --- | --- |
-| Type | `(call: any) => JSX.Element` |
-| Default | Built-in list item |
-
----
-
-### leadingView
-
-Custom renderer for the avatar / left section.
-
-| | |
-| --- | --- |
-| Type | `(call: any) => JSX.Element` |
-| Default | Built-in avatar |
-
----
-
-### loadingView
-
-Custom component displayed during the loading state.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in shimmer |
-
----
-
-### onCallButtonClicked
-
-Callback fired when the call-back button is clicked.
-
-| | |
-| --- | --- |
-| Type | `(call: any) => void` |
-| Default | `undefined` |
-
----
-
-### onError
-
-Callback fired when the component encounters an error.
-
-| | |
-| --- | --- |
-| Type | `((error: CometChat.CometChatException) => void) \| null` |
-| Default | `undefined` |
-
----
-
-### onItemClick
-
-Callback fired when a call log entry is clicked.
-
-| | |
-| --- | --- |
-| Type | `(call: any) => void` |
-| Default | `undefined` |
-
----
-
-### showScrollbar
-
-Shows the scrollbar in the call log list.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### subtitleView
-
-Custom renderer for the subtitle text.
-
-| | |
-| --- | --- |
-| Type | `(call: any) => JSX.Element` |
-| Default | Built-in subtitle |
-
----
-
-### titleView
-
-Custom renderer for the name / title text.
-
-| | |
-| --- | --- |
-| Type | `(call: any) => JSX.Element` |
-| Default | Built-in title |
-
----
-
-### trailingView
-
-Custom renderer for the right section.
-
-| | |
-| --- | --- |
-| Type | `(call: any) => JSX.Element` |
-| Default | Built-in trailing view |
-
----
-
-## Events
-
-| Event | Payload | Fires when |
-| --- | --- | --- |
-| `CometChatMessageEvents.ccMessageSent` | `IMessages` | Call message sent |
-
----
-
-## CSS Selectors
-
-| Target | Selector |
-| --- | --- |
-| Root | `.cometchat-call-logs` |
-| List item | `.cometchat-call-logs .cometchat-list-item` |
-| Active item | `.cometchat-call-logs__list-item-active .cometchat-list-item` |
-| Trailing view (video) | `.cometchat-call-logs__list-item-trailing-view-video` |
-| Trailing view (audio) | `.cometchat-call-logs__list-item-trailing-view-audio` |
-| Subtitle | `.cometchat-call-logs__list-item-subtitle` |
-| Subtitle date | `.cometchat-call-logs__list-item-subtitle .cometchat-date` |
-| Missed call icon | `.cometchat-call-logs__list-item-subtitle-icon-missed-call` |
-| Outgoing call icon | `.cometchat-call-logs__list-item-subtitle-icon-outgoing-call` |
-| Incoming call icon | `.cometchat-call-logs__list-item-subtitle-icon-incoming-call` |
-| Empty state | `.cometchat-call-logs__empty-state-view` |
-| Error state | `.cometchat-call-logs__error-state-view` |
-| Shimmer loading | `.cometchat-call-logs__shimmer` |
-| Outgoing call overlay | `.cometchat-call-logs__outgoing-call` |
diff --git a/ui-kit/react/calling-integration.mdx b/ui-kit/react/calling-integration.mdx
index 4760a85b9..48857f176 100644
--- a/ui-kit/react/calling-integration.mdx
+++ b/ui-kit/react/calling-integration.mdx
@@ -1,28 +1,251 @@
---
title: "Calling Integration"
-description: "Add voice and video calling to CometChat React UI Kit with Calls SDK installation, setup checks, and CallButtons verification."
+description: "Step-by-step guide to integrate voice and video calling into your React app using CometChat UI Kit v7."
---
-## Overview
+## Goal
-This guide walks you through adding voice and video calling capabilities to your React application using the CometChat UI Kit.
+By the end of this guide you will have voice and video calling working in your React app — including the `CometChatCallButtons` component, incoming call notifications, and outgoing call screens.
-
-Make sure you've completed the [Getting Started](/ui-kit/react/react-js-integration) guide before proceeding.
-
+## Prerequisites
-## Add the Calls SDK
+- A working CometChat React UI Kit v7 setup (completed the [Integration Guide](/ui-kit/react/integration-react))
+- `CometChatUIKit.init()` and `login()` completed before rendering
+- A CometChat plan that includes calling features enabled in your [dashboard](https://app.cometchat.com)
-Install the CometChat Calls SDK:
+## Step 1: Install the Calls SDK
-```bash
+The calling feature requires the optional `@cometchat/calls-sdk-javascript` peer dependency:
+
+
+
+```bash npm
npm install @cometchat/calls-sdk-javascript
```
-## Verify Integration
+```bash yarn
+yarn add @cometchat/calls-sdk-javascript
+```
+
+```bash pnpm
+pnpm add @cometchat/calls-sdk-javascript
+```
+
+
+
+This package provides the WebRTC layer for voice and video calls. It is loaded lazily by the UI Kit — no additional bundle cost until calling is actually used.
+
+## Step 2: Enable Calling in UIKitSettingsBuilder
+
+Set `.setCallingEnabled(true)` on your `UIKitSettingsBuilder` during initialization:
+
+```tsx title="src/main.tsx"
+import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
+
+const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
+ .subscribePresenceForAllUsers()
+ .setCallingEnabled(true)
+ .build();
+
+CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ // Render your app
+});
+```
+
+When calling is enabled, the UI Kit:
+- Registers the `CallingPlugin` for call-related message rendering
+- Lazy-loads call components (`CometChatIncomingCall`, `CometChatOutgoingCall`, `CometChatOngoingCall`) only when needed
+- Enables the `CometChatCallButtons` component to initiate calls
+
+When calling is not enabled (the default), call components are not loaded and `CometChatCallButtons` renders nothing.
+
+## Step 3: Configure call settings
+
+The Calls SDK uses the same `appId` and `region` from your `UIKitSettings` — no separate configuration is needed. The UI Kit passes these credentials to the Calls SDK automatically when calling is enabled.
+
+
+The `config` prop on `CometChatProvider` accepts a `CometChatGlobalConfig` object for UI/behavior flags (`hideReceipts`, `hideUserStatus`, `disableSoundForCalls`, `customSoundForCalls`, `callSettingsBuilder`). It does **not** take a separate calling app ID or region.
+
+
+## Step 4: Add Call Buttons via CometChatMessageHeader
+
+`CometChatMessageHeader` automatically renders voice and video call buttons when calling is enabled. No extra configuration needed — just render the header with a `user` or `group`:
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
+} from "@cometchat/chat-uikit-react";
+
+function ChatPanel({ user }: { user: CometChat.User }) {
+ return (
+
+
+
+
+
+ );
+}
+```
+
+The header shows call buttons by default. To hide them, use `hideVoiceCallButton` or `hideVideoCallButton`:
+
+```tsx
+
+```
+
+For group calls, pass the `group` prop instead:
+
+```tsx
+
+```
+
+
+`CometChatMessageHeader` renders its call buttons automatically (via the `CometChatMessageHeader.CallButtons` sub-component) — you don't import or render that sub-component separately. If you need call buttons **outside** the header, use the standalone [`CometChatCallButtons`](/ui-kit/react/components/call-buttons) component.
+
+
+## Step 5: Verify with a voice call
+
+With the setup complete, test a voice call:
+
+1. Open your app with two different users in separate browser tabs
+2. Click the **voice call** button (phone icon) in the chat header
+3. The caller sees the `CometChatOutgoingCall` screen with a "Calling..." indicator
+4. The receiver sees the `CometChatIncomingCall` overlay with accept/reject buttons
+5. Once accepted, both users enter the `CometChatOngoingCall` view with live audio
+
+```tsx
+import { useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatProvider,
+ CometChatConversations,
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
+} from "@cometchat/chat-uikit-react";
+
+export default function App() {
+ const [user, setUser] = useState(null);
+
+ const handleConversationClick = (conversation: CometChat.Conversation) => {
+ const conversationWith = conversation.getConversationWith();
+ if (conversationWith instanceof CometChat.User) {
+ setUser(conversationWith);
+ }
+ };
+
+ return (
+
+
+
+
+
+
+ {user && (
+ <>
+
+
+
+ >
+ )}
+
+
+
+ );
+}
+```
+
+## Step 6: Verify with a video call
+
+Video calls work identically — click the **video call** button (camera icon) instead. The `CometChatOngoingCall` component renders a full video interface with:
+
+- Local and remote video streams
+- Mute/unmute audio toggle
+- Camera on/off toggle
+- End call button
+
+No additional configuration is needed to switch between audio-only and video calls. The call type is determined by which button the user clicks.
+
+## Step 7: Render CometChatIncomingCall
+
+`CometChatIncomingCall` must be rendered in your app — it is NOT auto-rendered by the UI Kit. Place it at the root level of your authenticated layout so it can display the incoming call overlay from anywhere:
+
+```tsx
+import {
+ CometChatProvider,
+ CometChatIncomingCall,
+ CometChatConversations,
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
+} from "@cometchat/chat-uikit-react";
+
+export default function App() {
+ const [user, setUser] = useState(null);
+
+ const handleConversationClick = (conversation: CometChat.Conversation) => {
+ const conversationWith = conversation.getConversationWith();
+ if (conversationWith instanceof CometChat.User) {
+ setUser(conversationWith);
+ }
+ };
+
+ return (
+
+
+
+
+
+
+ {user && (
+ <>
+
+
+
+ >
+ )}
+
+
+
+ {/* Incoming call overlay — renders at root level, listens for call events */}
+
+
+ );
+}
+```
+
+`CometChatIncomingCall` listens for incoming call events and displays an accept/reject overlay. When the user accepts, it transitions to the `CometChatOngoingCall` screen internally. You can customize its behavior with callbacks:
+
+```tsx
+ console.log("Call accepted:", call)}
+ onDecline={(call) => console.log("Call declined:", call)}
+/>
+```
+
+`CometChatOutgoingCall` is rendered automatically by the `CometChatCallButtons` component when the user initiates a call — you do not need to place it manually.
+
+## Summary
+
+| Step | Action |
+|------|--------|
+| 1 | Install `@cometchat/calls-sdk-javascript` |
+| 2 | Set `.setCallingEnabled(true)` on `UIKitSettingsBuilder` |
+| 3 | (Optional) Configure call behavior via `config` prop on `CometChatProvider` |
+| 4 | Call buttons appear in `CometChatMessageHeader` automatically |
+| 5 | Test voice calls between two users |
+| 6 | Test video calls between two users |
+| 7 | (Optional) Customize incoming/outgoing call handlers |
-After adding the dependency, the React UI Kit will automatically detect it and activate calling features. You will see [CallButtons](/ui-kit/react/call-buttons) rendered in the [MessageHeader](/ui-kit/react/message-header) component.
+## Next Steps
-
-
-
+- [Message Header](/ui-kit/react/components/message-header) — full props reference including call button visibility
+- [Call Logs](/ui-kit/react/components/call-logs) — display call history
+- [CometChatProvider](/ui-kit/react/cometchat-provider) — all provider configuration options
diff --git a/ui-kit/react/campaigns.mdx b/ui-kit/react/campaigns.mdx
index 989cdb05e..71080b1ec 100644
--- a/ui-kit/react/campaigns.mdx
+++ b/ui-kit/react/campaigns.mdx
@@ -6,7 +6,7 @@ description: "Deliver targeted, rich notifications to users via an in-app notifi
CometChat Campaigns enables you to send rich, interactive notifications to users through an in-app notification feed. Each notification is rendered as a native card using the **CometChat Cards** library — supporting images, text, buttons, layouts, and interactive actions.
-Before proceeding, ensure you have completed the [UI Kit integration](/ui-kit/react/getting-started) and the [Dashboard Setup](/campaigns#setup-flow) for Campaigns.
+Before proceeding, ensure you have completed the [UI Kit integration](/ui-kit/react/integration-react) and the [Dashboard Setup](/campaigns#setup-flow) for Campaigns.
@@ -153,7 +153,7 @@ When a campaign push notification arrives via Web Push or FCM, you should:
2. **Report click** — Call `CometChat.markPushNotificationClicked()` when the user clicks the notification
3. **Deep link** — Use the announcement ID from the push payload to fetch the full item via `CometChat.getNotificationFeedItem(id)` and display it
-```tsx lines
+```tsx
import { CometChat } from "@cometchat/chat-sdk-javascript";
// When push notification is received (e.g., in service worker)
@@ -181,9 +181,8 @@ Before integrating the frontend, you need to set up channels, categories, templa
The easiest way to add a notification feed to your app is the `CometChatNotificationFeed` component. It handles fetching, rendering, pagination, filtering, real-time updates, and engagement reporting out of the box.
-```tsx lines
+```tsx
import { CometChatNotificationFeed } from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/css-variables.css";
function NotificationsScreen() {
return (
@@ -199,7 +198,7 @@ function NotificationsScreen() {
}
```
-See the full [CometChatNotificationFeed component documentation](/ui-kit/react/notification-feed) for all configuration options, styling, and customization.
+See the full [CometChatNotificationFeed component documentation](/ui-kit/react/components/notification-feed) for all configuration options, styling, and customization.
---
@@ -209,7 +208,7 @@ See the full [CometChatNotificationFeed component documentation](/ui-kit/react/n
Full API reference for feed items, categories, engagement, and push tracking
-
+
Ready-to-use component with filtering, real-time updates, and styling
diff --git a/ui-kit/react/cometchat-provider.mdx b/ui-kit/react/cometchat-provider.mdx
new file mode 100644
index 000000000..47229eba4
--- /dev/null
+++ b/ui-kit/react/cometchat-provider.mdx
@@ -0,0 +1,220 @@
+---
+title: "CometChatProvider"
+description: "The root provider that composes all internal contexts (plugin registry, theme, locale, global config, events) for the React UI Kit."
+---
+
+## Overview
+
+Every CometChat component must be rendered inside a `` which supplies theme, locale, plugin registry, global config, and real-time events to the component tree.
+
+`CometChatProvider` does **not** handle SDK initialization or user login. You must call `CometChatUIKit.init()` and `CometChatUIKit.login()` (or `loginWithAuthToken()`) imperatively before mounting the provider.
+
+---
+
+## Setup Pattern
+
+The setup is always the same: initialize, login, then render.
+
+```tsx title="src/main.tsx"
+import ReactDOM from "react-dom/client";
+import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
+import App from "./App";
+
+const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("us")
+ .setAuthKey("YOUR_AUTH_KEY")
+ .subscribePresenceForAllUsers()
+ .setCallingEnabled(true)
+ .build();
+
+CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ ReactDOM.createRoot(document.getElementById("root")!).render();
+});
+```
+
+```tsx title="src/App.tsx"
+import { CometChatProvider, CometChatConversations } from "@cometchat/chat-uikit-react";
+
+function App() {
+ return (
+
+
+
+ );
+}
+
+export default App;
+```
+
+For production, use `CometChatUIKit.loginWithAuthToken(token)` instead of `login(uid)`.
+
+---
+
+## Props
+
+| Prop | Type | Required | Default | Description |
+| --- | --- | --- | --- | --- |
+| `plugins` | `CometChatMessagePlugin[]` | No | — | Additional plugins beyond the defaults |
+| `config` | `CometChatGlobalConfig` | No | `{}` | Global flags (`hideReceipts`, `hideUserStatus`, etc.) |
+| `theme` | `"light" \| "dark"` | No | `"light"` | Active theme |
+| `locale` | `string` | No | `"en-us"` | Language code for localization |
+| `children` | `ReactNode` | Yes | — | Your app content |
+
+---
+
+## With Custom Theme and Locale
+
+```tsx
+
+
+
+```
+
+---
+
+## With Additional Plugins
+
+All default plugins (text, image, file, audio, video, AI, etc.) are always included. Pass your own custom plugins via the `plugins` prop:
+
+```tsx
+import { CometChatProvider } from "@cometchat/chat-uikit-react";
+import { MyCustomPlugin } from "./plugins/MyCustomPlugin";
+
+
+
+
+```
+
+---
+
+## With Global Config
+
+```tsx
+
+
+
+```
+
+---
+
+## Accessing the Logged-In User
+
+Inside your components (children of `CometChatProvider`), access the logged-in user via the `useLoggedInUser()` hook or `CometChatUIKit.getLoggedInUser()`:
+
+```tsx
+import { useLoggedInUser } from "@cometchat/chat-uikit-react";
+
+function MyComponent() {
+ const loggedInUser = useLoggedInUser();
+
+ if (!loggedInUser) return
Loading...
;
+
+ return
Welcome, {loggedInUser.getName()}
;
+}
+```
+
+---
+
+## Internal Architecture
+
+`CometChatProvider` composes these internal providers in order:
+
+```
+CometChatProvider
+ └─ PluginRegistryContext — plugin registry from CometChatUIKit
+ └─ GlobalConfigProvider — hideReceipts, hideUserStatus, etc.
+ └─ ThemeProvider — data-theme attribute + CSS variables
+ └─ LocaleProvider — localization translations
+ └─ EventsProvider — SDK listeners + UI events
+ └─ {children}
+```
+
+---
+
+## Next.js App Router
+
+`CometChatProvider` uses browser APIs internally, so it must be placed inside a Client Component. Additionally, init and login must happen client-side.
+
+```tsx title="app/providers.tsx"
+"use client";
+
+import { useEffect, useState } from "react";
+import { CometChatUIKit, UIKitSettingsBuilder, CometChatProvider } from "@cometchat/chat-uikit-react";
+
+export function ChatProviders({ children }: { children: React.ReactNode }) {
+ const [ready, setReady] = useState(false);
+
+ useEffect(() => {
+ const settings = new UIKitSettingsBuilder()
+ .setAppId(process.env.NEXT_PUBLIC_COMETCHAT_APP_ID!)
+ .setRegion(process.env.NEXT_PUBLIC_COMETCHAT_REGION!)
+ .setAuthKey(process.env.NEXT_PUBLIC_COMETCHAT_AUTH_KEY!)
+ .setCallingEnabled(true)
+ .build();
+
+ CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.loginWithAuthToken(getAuthToken());
+ setReady(true);
+ });
+ }, []);
+
+ if (!ready) return null;
+
+ return (
+
+ {children}
+
+ );
+}
+```
+
+---
+
+## Migration from v6
+
+In v6, initialization was imperative — call `init()` then `login()`, then render. v7 works the same way:
+
+```tsx title="v6 (before)"
+import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
+
+const settings = new UIKitSettingsBuilder()
+ .setAppId("APP_ID")
+ .setRegion("REGION")
+ .setAuthKey("AUTH_KEY")
+ .build();
+
+await CometChatUIKit.init(settings);
+await CometChatUIKit.login("USER_ID");
+// Then render your app
+```
+
+```tsx title="v7 (after)"
+import { CometChatUIKit, UIKitSettingsBuilder, CometChatProvider } from "@cometchat/chat-uikit-react";
+
+const settings = new UIKitSettingsBuilder()
+ .setAppId("APP_ID")
+ .setRegion("REGION")
+ .setAuthKey("AUTH_KEY")
+ .build();
+
+await CometChatUIKit.init(settings);
+await CometChatUIKit.login("USER_ID");
+
+// Then render with CometChatProvider wrapping your components
+function App() {
+ return (
+
+
+
+ );
+}
+```
+
+Key differences:
+- v7 uses `CometChatProvider` to supply React context (theme, locale, plugins, events)
+- Init and login are still imperative — same as v6
+- Default plugins are included automatically
+- Theme and locale are props on the provider
+- Real-time events are managed internally (no RxJS, no manual listener setup)
diff --git a/ui-kit/react/compact-message-composer.mdx b/ui-kit/react/compact-message-composer.mdx
deleted file mode 100644
index 6f8ee5365..000000000
--- a/ui-kit/react/compact-message-composer.mdx
+++ /dev/null
@@ -1,1264 +0,0 @@
----
-title: "Compact Message Composer"
-description: "A compact, single-line message input component with rich text formatting, attachments, mentions, and voice recording support."
----
-
-
-
-```json
-{
- "component": "CometChatCompactMessageComposer",
- "package": "@cometchat/chat-uikit-react",
- "import": "import { CometChatCompactMessageComposer } from \"@cometchat/chat-uikit-react\";",
- "description": "Compact single-line message input with optional rich text formatting (bold, italic, underline, strikethrough, code, links, lists, blockquotes), attachments, mentions, voice recording, and message editing support.",
- "primaryOutput": {
- "prop": "onSendButtonClick",
- "type": "(message: CometChat.BaseMessage) => void"
- },
- "props": {
- "data": {
- "user": { "type": "CometChat.User", "default": "undefined" },
- "group": { "type": "CometChat.Group", "default": "undefined" },
- "parentMessageId": { "type": "number", "default": "undefined" },
- "initialComposerText": { "type": "string", "default": "\"\"" },
- "placeholderText": { "type": "string", "default": "\"Type a message...\"" }
- },
- "callbacks": {
- "onSendButtonClick": "(message: CometChat.BaseMessage) => void",
- "onTextChange": "(text: string) => void",
- "onError": "(error: CometChat.CometChatException) => void"
- },
- "visibility": {
- "hideImageAttachmentOption": { "type": "boolean", "default": false },
- "hideVideoAttachmentOption": { "type": "boolean", "default": false },
- "hideAudioAttachmentOption": { "type": "boolean", "default": false },
- "hideFileAttachmentOption": { "type": "boolean", "default": false },
- "hidePollsOption": { "type": "boolean", "default": false },
- "hideCollaborativeDocumentOption": { "type": "boolean", "default": false },
- "hideCollaborativeWhiteboardOption": { "type": "boolean", "default": false },
- "hideAttachmentButton": { "type": "boolean", "default": false },
- "hideVoiceRecordingButton": { "type": "boolean", "default": false },
- "hideEmojiKeyboardButton": { "type": "boolean", "default": false },
- "hideStickersButton": { "type": "boolean", "default": false },
- "hideSendButton": { "type": "boolean", "default": false }
- },
- "richText": {
- "enableRichTextEditor": { "type": "boolean", "default": false },
- "hideRichTextFormattingOptions": { "type": "boolean", "default": false },
- "showToolbarOnSelection": { "type": "boolean", "default": false },
- "enterKeyBehavior": { "type": "EnterKeyBehavior", "default": "EnterKeyBehavior.SendMessage" }
- },
- "behavior": {
- "disableTypingEvents": { "type": "boolean", "default": false },
- "disableMentions": { "type": "boolean", "default": false },
- "disableMentionAll": { "type": "boolean", "default": false },
- "mentionAllLabel": { "type": "string", "default": "\"all\"" },
- "disableSoundForMessage": { "type": "boolean", "default": false },
- "showScrollbar": { "type": "boolean", "default": false }
- },
- "viewSlots": {
- "headerView": "JSX.Element",
- "auxiliaryButtonView": "JSX.Element",
- "sendButtonView": "JSX.Element"
- },
- "formatting": {
- "textFormatters": {
- "type": "CometChatTextFormatter[]",
- "default": "default formatters from data source"
- },
- "attachmentOptions": {
- "type": "CometChatMessageComposerAction[]",
- "note": "Custom attachment options list (replaces defaults)"
- }
- }
- },
- "events": [
- {
- "name": "ccMessageSent",
- "payload": "{ message: CometChat.BaseMessage, status: string }",
- "description": "Triggers when a message is sent with status: inProgress, success, or error"
- },
- {
- "name": "ccMessageEdited",
- "payload": "{ message: CometChat.BaseMessage, status: string }",
- "description": "Triggers when a message is edited with status: inProgress, success, or error"
- },
- {
- "name": "ccReplyToMessage",
- "payload": "{ message: CometChat.BaseMessage, status: string }",
- "description": "Triggers when a user replies to a message with status: inProgress, success, or error"
- }
- ],
- "compositionExample": {
- "description": "Compact message composer wired with message header and list for complete chat view",
- "components": [
- "CometChatMessageHeader",
- "CometChatMessageList",
- "CometChatCompactMessageComposer"
- ],
- "flow": "Pass user or group prop to composer -> onSendButtonClick fires with CometChat.BaseMessage -> message appears in MessageList"
- }
-}
-```
-
-
-## Overview
-
-`CometChatCompactMessageComposer` is a [Component](/ui-kit/react/components-overview#components) that provides a compact, single-line message input with optional rich text formatting capabilities. It supports bold, italic, underline, strikethrough, code, links, lists, and blockquotes.
-
-This is a compact variant of [CometChatMessageComposer](/ui-kit/react/message-composer). It shares a similar props API but provides a streamlined, single-line interface with rich text formatting controls.
-
-Wire it alongside `CometChatMessageHeader` and `CometChatMessageList` to build a standard chat view.
-
-Features such as **Rich Text Formatting**, **Attachments**, **Message Editing**, **Mentions**, **Link Previews**, and **Voice Recording** are supported.
-
-
-
-
-
-
-**Before using this component:** Ensure `CometChatUIKit.init(UIKitSettings)` has completed and the user is logged in via `CometChatUIKit.login("UID")`. See [React.js Integration](/ui-kit/react/react-js-integration).
-
-
-
-**Available via:** [UI Kits](/ui-kit/react/overview) | [SDK](/sdk/javascript/overview)
-
-
----
-
-## Minimal Render
-
-```tsx
-import { CometChatCompactMessageComposer } from "@cometchat/chat-uikit-react";
-
-function CompactComposerDemo() {
- return ;
-}
-
-export default CompactComposerDemo;
-```
-
----
-
-## Usage
-
-### Integration
-
-The following code snippet illustrates how you can directly incorporate the CompactMessageComposer component into your app.
-
-
-
-```tsx
-import React from "react";
-import { CometChat } from "@cometchat/chat-sdk-javascript";
-import { CometChatCompactMessageComposer } from "@cometchat/chat-uikit-react";
-
-export function CompactComposerDemo() {
- const [chatUser, setChatUser] = React.useState();
- React.useEffect(() => {
- CometChat.getUser("uid").then((user) => {
- setChatUser(user);
- });
- }, []);
-
- return chatUser ? (
-
- ) : null;
-}
-```
-
-
-
-
-
-**Expected result:**
-- The `CometChatCompactMessageComposer` component renders a compact, single-line message input
-- The input supports typing, sending messages, attachments, emoji, stickers, and voice recording
-- Clicking the send button dispatches the message to the specified `user`
-
----
-
-## Actions and Events
-
-### Callback Props
-
-[Actions](/ui-kit/react/components-overview#actions) dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.
-
-#### onSendButtonClick
-
-Fires when the send message button is clicked. Overrides the default send behavior.
-
-```tsx
-onSendButtonClick?: (message: CometChat.BaseMessage) => void
-```
-
-
-
-```tsx
-import React from "react";
-import { CometChat } from "@cometchat/chat-sdk-javascript";
-import { CometChatCompactMessageComposer } from "@cometchat/chat-uikit-react";
-
-export function CompactComposerDemo() {
- const [chatUser, setChatUser] = React.useState();
-
- React.useEffect(() => {
- CometChat.getUser("uid").then((user) => {
- setChatUser(user);
- });
- }, []);
-
- function handleSendButtonClick(message: CometChat.BaseMessage): void {
- console.log("your custom on send button click action");
- }
-
- return chatUser ? (
-
- ) : null;
-}
-```
-
-
-
-
-
-***
-
-
-
----
-
-## Next Steps
-
-
-
- Full-featured multi-line message composer component.
-
-
- Display messages with real-time updates.
-
-
- Implement @mentions in your chat application.
-
-
- Customize colors, fonts, and styling.
-
-
diff --git a/ui-kit/react/components-overview.mdx b/ui-kit/react/components-overview.mdx
index 4418f1c8d..b30e86e52 100644
--- a/ui-kit/react/components-overview.mdx
+++ b/ui-kit/react/components-overview.mdx
@@ -1,92 +1,219 @@
---
title: "Overview"
-description: "Browse all prebuilt UI components in the CometChat React UI Kit — conversations, messages, users, groups, calls, search, and AI."
+description: "Understand the component architecture, usage patterns, and all available components in the CometChat React UI Kit."
---
-
-
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Required setup | `CometChatUIKit.init()` + `CometChatUIKit.login()` before rendering any component |
-| Callback actions | `on={(param) => {}}` |
-| Data filtering | `RequestBuilder={new CometChat.RequestBuilder()}` |
-| Toggle features | `hide={true}` or `show={true}` |
-| Custom rendering | `View={() => JSX}` |
-| CSS overrides | Target `.cometchat-` class in global CSS |
-| Calling | Requires separate `@cometchat/calls-sdk-javascript` package |
-
-
-
## Architecture
-The UI Kit is a set of independent components that compose into chat layouts. A typical two-panel layout uses four core components:
+The UI Kit provides a set of independent, composable React components that wire together into complete chat layouts. A typical two-panel layout uses four core components:
-- **CometChatConversations** — sidebar listing recent conversations (users and groups)
-- **CometChatMessageHeader** — toolbar showing avatar, name, online status, and typing indicator
+- **CometChatConversations** — sidebar listing recent conversations
+- **CometChatMessageHeader** — toolbar showing avatar, name, status, and typing indicator
- **CometChatMessageList** — scrollable message feed with reactions, receipts, and threads
- **CometChatMessageComposer** — rich text input with attachments, mentions, and voice notes
-Data flow: selecting a conversation in CometChatConversations yields a `CometChat.User` or `CometChat.Group` object. That object is passed as a prop (`user` or `group`) to CometChatMessageHeader, CometChatMessageList, and CometChatMessageComposer. The message components use the SDK internally — CometChatMessageComposer sends messages, CometChatMessageList receives them via real-time listeners.
+Data flow: selecting a conversation yields a `CometChat.User` or `CometChat.Group` object. Pass that object as a prop (`user` or `group`) to the message components. They handle SDK calls internally — the composer sends messages, the list receives them via real-time listeners.
+
+All components must be rendered inside a `` which provides shared context (theme, locale, events). SDK initialization and login must be completed before the provider mounts.
+
+
+
+
+
+```tsx
+import {
+ CometChatProvider,
+ CometChatConversations,
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
+} from "@cometchat/chat-uikit-react";
+
+function ChatApp() {
+ const [user, setUser] = useState();
+
+ return (
+
+
+ setUser(conv.getConversationWith())} />
+
+
+
+
+
+
+
+ );
+}
+```
+
+---
+
+## Flat API
+
+All components — both feature and base — support the flat API. Render them in a single line with props, and they handle their layout internally.
+
+```tsx
+
+```
+
+This is the quickest way to get started. The component renders all its default sub-components (header, list, empty state, loading state, etc.) automatically.
+
+---
+
+## Compound Composition
+
+For full layout control, use the compound pattern. Each feature component is a namespace with sub-components:
+
+```tsx
+
+ {/* Only render what you need, and omit sub-components to hide them */}
+
+
+
+```
+
+Key principles:
+- **Root** initializes state, fetches data, and provides context to children.
+- **Sub-components** read from context and render when their state is active.
+- **Omit a sub-component** to hide it, no boolean props needed.
+- **Add custom elements** anywhere inside Root alongside the sub-components.
+
+Both APIs produce the same result. The flat API is shorthand for rendering Root with all sub-components in their default order.
+
+---
+
+## Component Categories
+
+Components are organized into three categories:
+
+### Feature Components
+
+Feature components integrate with the CometChat SDK for data fetching, real-time events, and state management. They follow the compound pattern and support both flat and compound APIs.
-Components communicate through a publish/subscribe event bus (`CometChatMessageEvents`, `CometChatConversationEvents`, `CometChatGroupEvents`, etc.). A component emits events that other components or application code can subscribe to without direct references. See [Events](/ui-kit/react/events) for the full list.
+Feature components:
+- Own their data lifecycle (fetch, paginate, refresh)
+- Subscribe to real-time SDK events (new messages, presence changes, typing indicators)
+- Manage complex state via hooks and reducers
+- Provide context to their sub-components
-Each component accepts callback props (`on`), view slot props (`View`) for replacing UI sections, `RequestBuilder` props for data filtering, and CSS variable overrides on `.cometchat-` classes.
+### Base Components
+
+Base components are pure UI building blocks with no SDK integration. They accept props and render UI — no network calls, no real-time events. Feature components compose these internally. Base components support both flat API and compound composition.
---
-## Component Catalog
+## Feature Components
-All components are imported from `@cometchat/chat-uikit-react`.
+All feature components are imported from `@cometchat/chat-uikit-react`.
### Conversations and Lists
-| Component | Purpose | Key Props | Page |
-| --- | --- | --- | --- |
-| CometChatConversations | Scrollable list of recent conversations | `conversationsRequestBuilder`, `onItemClick`, `onError` | [Conversations](/ui-kit/react/conversations) |
-| CometChatUsers | Scrollable list of users | `usersRequestBuilder`, `onItemClick`, `onError` | [Users](/ui-kit/react/users) |
-| CometChatGroups | Scrollable list of groups | `groupsRequestBuilder`, `onItemClick`, `onError` | [Groups](/ui-kit/react/groups) |
-| CometChatGroupMembers | Scrollable list of group members | `group`, `groupMemberRequestBuilder`, `onItemClick` | [Group Members](/ui-kit/react/group-members) |
+| Component | Purpose | Page |
+| --- | --- | --- |
+| `CometChatConversations` | Scrollable list of recent conversations with real-time updates | [Conversations](/ui-kit/react/components/conversations) |
+| `CometChatUsers` | Searchable list of users with selection support | [Users](/ui-kit/react/components/cometchat-users) |
+| `CometChatGroups` | Searchable list of groups with selection support | [Groups](/ui-kit/react/components/cometchat-groups) |
+| `CometChatGroupMembers` | List of group members with role-based actions | [Group Members](/ui-kit/react/components/cometchat-group-members) |
### Messages
-| Component | Purpose | Key Props | Page |
+| Component | Purpose | Page |
+| --- | --- | --- |
+| `CometChatMessageHeader` | Toolbar with avatar, name, status, typing indicator, and call buttons | [Message Header](/ui-kit/react/components/message-header) |
+| `CometChatMessageList` | Scrollable message feed with plugin-based bubble rendering | [Message List](/ui-kit/react/components/message-list) |
+| `CometChatMessageComposer` | Rich text input with attachments, emoji, voice recording, and formatting | [Message Composer](/ui-kit/react/components/message-composer) |
+| `CometChatMessageBubble` | Message bubble container with alignment, receipts, options, and reactions | [Message Bubble](/ui-kit/react/components/message-bubble) |
+| `CometChatThreadHeader` | Parent message bubble and reply count for threaded conversations | [Thread Header](/ui-kit/react/components/thread-header) |
+| `CometChatMessageInformation` | Message delivery and read receipt details panel | [Message Information](/ui-kit/react/components/message-information) |
+| `CometChatReactions` | Reaction chips bar with reactor list popover | [Reactions](/ui-kit/react/components/reactions) |
+| `CometChatReactionList` | Full reactor list with tabs and pagination | [Reaction List](/ui-kit/react/components/reaction-list) |
+| `CometChatFlagMessageDialog` | Modal dialog for reporting/flagging messages with reason selection | [Flag Message Dialog](/ui-kit/react/components/flag-message-dialog) |
+
+### Message Bubbles
+
+Message bubble components accept a `message` object and self-extract all required data (text, attachments, metadata, sender info). Unlike v6 where bubbles were purely presentational, v7 bubbles are self-contained — they derive their rendering state directly from the SDK message.
+
+| Component | Message Type | Purpose | Page |
| --- | --- | --- | --- |
-| CometChatMessageHeader | Toolbar with avatar, name, status, typing indicator | `user`, `group`, `enableAutoSummaryGeneration` | [Message Header](/ui-kit/react/message-header) |
-| CometChatMessageList | Scrollable message list with reactions, receipts, threads | `user`, `group`, `messagesRequestBuilder`, `goToMessageId` (string) | [Message List](/ui-kit/react/message-list) |
-| CometChatMessageComposer | Rich text input with attachments, mentions, voice notes | `user`, `group`, `onSendButtonClick`, `placeholderText` | [Message Composer](/ui-kit/react/message-composer) |
-| CometChatMessageTemplate | Pre-defined structure for custom message bubbles | `type`, `category`, `contentView`, `headerView`, `footerView` | [Message Template](/ui-kit/react/message-template) |
-| CometChatThreadHeader | Parent message bubble and reply count for threaded view | `parentMessage`, `onClose`, `hideReceipts`, `textFormatters` | [Thread Header](/ui-kit/react/thread-header) |
+| `CometChatTextBubble` | `text` | Formatted text with mentions, URLs, markdown, and link previews | [Text Bubble](/ui-kit/react/components/text-bubble) |
+| `CometChatImageBubble` | `image` | Image grid with captions and click-to-fullscreen | [Image Bubble](/ui-kit/react/components/image-bubble) |
+| `CometChatVideoBubble` | `video` | Video player with thumbnail and caption | [Video Bubble](/ui-kit/react/components/video-bubble) |
+| `CometChatAudioBubble` | `audio` | Waveform audio player with caption | [Audio Bubble](/ui-kit/react/components/audio-bubble) |
+| `CometChatFileBubble` | `file` | File card with name, size, and download button | [File Bubble](/ui-kit/react/components/file-bubble) |
+| `CometChatPollBubble` | `extension_poll` | Poll with options, voting, and results | [Poll Bubble](/ui-kit/react/components/poll-bubble) |
+| `CometChatStickerBubble` | `extension_sticker` | Sticker image display | [Sticker Bubble](/ui-kit/react/components/sticker-bubble) |
+| `CometChatCollaborativeDocumentBubble` | `extension_document` | Document collaboration link with join button | [Collaborative Document Bubble](/ui-kit/react/components/collaborative-document-bubble) |
+| `CometChatCollaborativeWhiteboardBubble` | `extension_whiteboard` | Whiteboard collaboration link with join button | [Collaborative Whiteboard Bubble](/ui-kit/react/components/collaborative-whiteboard-bubble) |
+| `CometChatGroupActionBubble` | `groupMember` | Group membership system messages (joined, left, kicked, banned, scope change) | [Group Action Bubble](/ui-kit/react/components/group-action-bubble) |
+| `CometChatCallActionBubble` | `audio`, `video` (call category) | Call status system messages (missed, outgoing, incoming, ended) | [Call Action Bubble](/ui-kit/react/components/call-action-bubble) |
+| `CometChatCallBubble` | `meeting` (custom) | Direct call / meeting invitation bubble | [Call Bubble](/ui-kit/react/components/call-bubble) |
### Calling
-| Component | Purpose | Key Props | Page |
-| --- | --- | --- | --- |
-| CometChatCallButtons | Voice and video call initiation buttons | `user`, `group`, `onVoiceCallClick`, `onVideoCallClick` | [Call Buttons](/ui-kit/react/call-buttons) |
-| CometChatIncomingCall | Incoming call notification with accept/decline | `call`, `onAccept(call)`, `onDecline(call)` | [Incoming Call](/ui-kit/react/incoming-call) |
-| CometChatOutgoingCall | Outgoing call screen with cancel control | `call`, `onCloseClicked` | [Outgoing Call](/ui-kit/react/outgoing-call) |
-| CometChatCallLogs | Scrollable list of call history | `callLogsRequestBuilder`, `onItemClick` | [Call Logs](/ui-kit/react/call-logs) |
+| Component | Purpose | Page |
+| --- | --- | --- |
+| `CometChatCallButtons` | Voice and video call initiation buttons | [Call Buttons](/ui-kit/react/components/call-buttons) |
+| `CometChatIncomingCall` | Incoming call notification with accept/decline | [Incoming Call](/ui-kit/react/components/incoming-call) |
+| `CometChatOutgoingCall` | Outgoing call screen with cancel control | [Outgoing Call](/ui-kit/react/components/outgoing-call) |
+| `CometChatCallLogs` | Scrollable list of call history | [Call Logs](/ui-kit/react/components/call-logs) |
### Search and AI
-| Component | Purpose | Key Props | Page |
-| --- | --- | --- | --- |
-| CometChatSearch | Real-time search across conversations and messages | `onConversationClicked(conversation, searchKeyword?)`, `onMessageClicked(message, searchKeyword?)`, `uid`, `guid`, `textFormatters` | [Search](/ui-kit/react/search) |
-| CometChatAIAssistantChat | AI agent chat with streaming, suggestions, history | `user`, `onSendButtonClick(message, previewMessageMode?)`, `aiAssistantTools` | [AI Assistant Chat](/ui-kit/react/ai-assistant-chat) |
+| Component | Purpose | Page |
+| --- | --- | --- |
+| `CometChatSearch` | Unified search across conversations and messages | [Search](/ui-kit/react/components/search) |
+| `CometChatAIAssistantChat` | AI agent chat with streaming, suggestions, and history | [AI Assistant](/ui-kit/react/components/ai-assistant) |
-## Component API Pattern
+---
-All components share a consistent API surface.
+## Base Components
-### Actions
+Base components are imported from `@cometchat/chat-uikit-react`. They don't have individual doc pages — use the source types and Storybook for reference.
+
+| Component | Purpose |
+| --- | --- |
+| `CometChatActionBubble` | Reusable pill-shaped system message bubble (used by GroupActionBubble and CallActionBubble) |
+| `CometChatActionSheet` | Bottom sheet with grouped action items |
+| `CometChatAvatar` | User/group avatar with image and initials fallback |
+| `CometChatButton` | Styled button with icon, text, loading, and variant support |
+| `CometChatChangeScope` | Group member role/scope change selector |
+| `CometChatCheckbox` | Checkbox input with label and controlled/uncontrolled support |
+| `CometChatConfirmDialog` | Confirmation dialog with customizable message and buttons |
+| `CometChatContextMenu` | Options menu with top-row icons and overflow dropdown |
+| `CometChatConversationStarter` | AI-generated conversation starter suggestions as clickable pills |
+| `CometChatConversationSummary` | AI-generated conversation summary display |
+| `CometChatDate` | Formatted date/time display with temporal bucketing |
+| `CometChatDeleteBubble` | "This message was deleted" placeholder bubble |
+| `CometChatDownloadButton` | Download button for file and media attachments |
+| `CometChatEmojiKeyboard` | Emoji picker with category tabs and search |
+| `CometChatErrorBoundary` | Error isolation wrapper with fallback UI and retry |
+| `CometChatFormattingToolbar` | Rich text formatting toolbar (bold, italic, lists, links, code) |
+| `CometChatFullScreenViewer` | Full-screen image/media viewer with download |
+| `CometChatLinkDialog` | Dialog for inserting or editing hyperlinks |
+| `CometChatLinkPopover` | Popover for previewing and editing links inline |
+| `CometChatListItem` | Standardized list item with avatar, title, subtitle, and tail |
+| `CometChatMediaRecorder` | Audio recording with timer, preview, and submit |
+| `CometChatModerationView` | Content moderation indicator and action view |
+| `CometChatPopover` | Positioning utility component for popovers and dropdowns |
+| `CometChatRadioButton` | Radio button input with label support |
+| `CometChatSearchBar` | Search input with clear button and keyboard handling |
+| `CometChatSmartReplies` | AI-powered reply suggestions as clickable chips |
+| `CometChatThreadView` | Inline thread reply indicator with reply count and unread dot |
+| `CometChatToast` | Toast notification for transient feedback messages |
+| `CometChatTypingIndicator` | Animated typing indicator with user attribution |
-Actions control component behavior. They split into two categories:
+---
+
+## Component API Pattern
-**Predefined Actions** are built into the component and execute automatically on user interaction (e.g., clicking send dispatches the message). No configuration needed.
+All components share a consistent API surface for customization.
-**User-Defined Actions** are callback props that fire on specific events. Override them to customize behavior:
+### Actions (Callbacks)
-```tsx lines
+Callback props fire on user interactions. Override them to customize behavior:
+
+```tsx
openThreadPanel(message)}
@@ -94,74 +221,67 @@ Actions control component behavior. They split into two categories:
/>
```
-### Events
-
-Events enable decoupled communication between components. A component emits events that other parts of the application can subscribe to without direct references.
+### Filters (RequestBuilder)
-```tsx lines
-import { CometChatMessageEvents } from "@cometchat/chat-uikit-react";
+List components accept `RequestBuilder` props to control which data loads:
-const sub = CometChatMessageEvents.ccMessageSent.subscribe((message) => {
- // react to sent message
-});
-
-// cleanup
-sub?.unsubscribe();
+```tsx
+
```
-Each component page documents its emitted events in the Events section.
+Pass the builder instance — not the result of `.build()`.
-### Filters
+### View Props
-List-based components accept `RequestBuilder` props to control which data loads:
+View props replace the visual content inside a component slot while keeping the default behavior wired:
-```tsx lines
-}
+ headerView={}
+ auxiliaryButtonView={}
/>
```
-### Custom View Slots
+For deeper control, use compound composition to replace entire slots including their behavior.
-Components expose named view slots to replace sections of the default UI:
+### CSS Styling
-```tsx lines
-}
- subtitleView={}
- leadingView={}
-/>
-```
+Components use CSS custom properties (design tokens). Override them on the `.cometchat` root or on component-specific selectors:
-### CSS Overrides
-
-Every component has a root CSS class (`.cometchat-`) for style customization:
+```css
+.cometchat {
+ --cometchat-primary-color: #6851d6;
+ --cometchat-font-family: "Inter", sans-serif;
+}
-```css lines
-.cometchat-message-list .cometchat-text-bubble__body-text {
- font-family: "SF Pro";
+.cometchat-message-list {
+ --cometchat-background-color-01: #fafafa;
}
```
+Component class names follow BEM convention: `.cometchat-component-name__element--modifier`.
+
---
## Next Steps
-
- Chat features included out of the box
+
+ Customize colors, fonts, and spacing with CSS variables
-
- Customize colors, fonts, and styles
+
+ Customize message rendering with the plugin system
-
- Add-on features like polls, stickers, and translation
+
+ Subscribe to real-time events across components
-
+
Task-oriented tutorials for common patterns
diff --git a/ui-kit/react/v7/components/ai-assistant-chat.mdx b/ui-kit/react/components/ai-assistant-chat.mdx
similarity index 98%
rename from ui-kit/react/v7/components/ai-assistant-chat.mdx
rename to ui-kit/react/components/ai-assistant-chat.mdx
index e0b13a988..090a1c8ec 100644
--- a/ui-kit/react/v7/components/ai-assistant-chat.mdx
+++ b/ui-kit/react/components/ai-assistant-chat.mdx
@@ -9,7 +9,6 @@ description: "AI agent chat interface with streaming responses, suggested messag
"component": "CometChatAIAssistantChat",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatAIAssistantChat } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "AI agent chat interface with streaming responses, suggested messages, tool calling, and conversation history.",
"cssRootClass": ".cometchat-ai-assistant-chat",
"primaryOutput": {
@@ -788,13 +787,13 @@ Custom auxiliary button view for the header. Replaces the default New Chat + His
## Next Steps
-
+
Display messages in a conversation
-
+
Compose and send messages
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/components/audio-bubble.mdx b/ui-kit/react/components/audio-bubble.mdx
new file mode 100644
index 000000000..789c504ae
--- /dev/null
+++ b/ui-kit/react/components/audio-bubble.mdx
@@ -0,0 +1,138 @@
+---
+title: "Audio Bubble"
+sidebarTitle: "Audio Bubble"
+description: "A self-extracting bubble that renders an audio attachment with play/pause controls, a progress bar, duration, and download."
+---
+
+
+```json
+{
+ "component": "CometChatAudioBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatAudioBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting audio bubble. Extracts the audio attachment and caption from a MediaMessage and renders inline playback controls.",
+ "cssRootClass": ".cometchat-audio-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.MediaMessage", "required": true, "note": "Drives extraction of audio attachments and caption." },
+ "alignment": { "type": "\"left\" | \"right\"", "note": "Defaults to sender-vs-logged-in-user." },
+ "textFormatters": { "type": "CometChatTextFormatter[]" },
+ "className": { "type": "string" }
+ }
+ }
+}
+```
+
+
+## Overview
+
+`CometChatAudioBubble` renders an audio attachment with inline playback. It is **self-extracting**: pass the SDK `message` and the bubble derives the audio attachment(s) and caption itself, reading alignment and localization from hooks, so it works standalone. It shows play/pause controls, a seekable progress bar, elapsed/total time, and a download control.
+
+
+**Live Preview** — interact with the audio bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-message-bubble-audio--default)
+
+
+
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatAudioBubble } from "@cometchat/chat-uikit-react";
+
+function AudioMessage({ message }: { message: CometChat.MediaMessage }) {
+ return ;
+}
+```
+
+---
+
+## Props
+
+### message
+
+The audio message. The bubble extracts attachments and caption from it. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.MediaMessage` |
+| Required | Yes |
+
+---
+
+### alignment
+
+Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.
+
+| | |
+| --- | --- |
+| Type | `"left" \| "right"` |
+| Default | derived |
+
+---
+
+### textFormatters
+
+Text formatters applied to the caption (mentions, URLs).
+
+| | |
+| --- | --- |
+| Type | `CometChatTextFormatter[]` |
+| Default | `undefined` |
+
+---
+
+### className
+
+Additional CSS class applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-audio-bubble` |
+| Sender / receiver | `.cometchat-audio-bubble--sender` / `.cometchat-audio-bubble--receiver` |
+| Play button | `.cometchat-audio-bubble__play-button` |
+| Pause button | `.cometchat-audio-bubble__pause-button` |
+| Progress (foreground) | `.cometchat-audio-bubble__progress-fg` |
+| Time | `.cometchat-audio-bubble__time` |
+| Download button | `.cometchat-audio-bubble__download-button` |
+| Caption | `.cometchat-audio-bubble__caption` |
+
+---
+
+## Next Steps
+
+
+
+ Plugin behavior, context menu, and conversation preview
+
+
+ Render generic file attachments
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/components/call-action-bubble.mdx b/ui-kit/react/components/call-action-bubble.mdx
new file mode 100644
index 000000000..16032d5a1
--- /dev/null
+++ b/ui-kit/react/components/call-action-bubble.mdx
@@ -0,0 +1,179 @@
+---
+title: "Call Action Bubble"
+sidebarTitle: "Call Action Bubble"
+description: "A self-extracting bubble that renders call status system messages like 'Missed Call', 'Call Ended', and 'Outgoing Call' from an SDK call message."
+---
+
+
+```json
+{
+ "component": "CometChatCallActionBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatCallActionBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting bubble for call status system messages. Derives the status text, icon, and error color from the SDK call message and the logged-in user.",
+ "cssRootClass": ".cometchat-action-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.BaseMessage", "required": true, "note": "The call message (audio/video) in the 'call' category. Drives all extraction." },
+ "className": { "type": "string", "default": "undefined", "note": "Additional CSS class for the root element" }
+ }
+ },
+ "rendersThrough": "CometChatActionBubble (base primitive)",
+ "usedBy": ["CometChatCallActionPlugin"]
+}
+```
+
+
+## Overview
+
+`CometChatCallActionBubble` renders a centered, pill-shaped call status system message — "Missed Call", "Call Ended", "Outgoing Call", etc. It is **self-extracting**: pass the SDK call message and the bubble derives the status text, the status icon, and whether to use the error (missed-call) color itself, reading the logged-in user and locale from hooks. This means it works standalone — no plugin required.
+
+It is the component the [Call Action Plugin](/ui-kit/react/plugins/overview#built-in-plugins) forwards to, and it renders through the presentational `CometChatActionBubble` base primitive.
+
+
+**Live Preview** — interact with the call action bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-call-action-bubble--outgoing-calls)
+
+
+
+
+> The component renders nothing while the logged-in user is unavailable.
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCallActionBubble } from "@cometchat/chat-uikit-react";
+
+function CallStatusMessage({ message }: { message: CometChat.BaseMessage }) {
+ return ;
+}
+```
+
+---
+
+## What It Derives
+
+The bubble inspects the call's status and whether it was initiated by the logged-in user to pick the text, icon, and color.
+
+### Status Text
+
+**Sent by the logged-in user:**
+
+| Call status | Text |
+| --- | --- |
+| `initiated` | Outgoing Call |
+| `ongoing` | Answered Call |
+| `ended` | Call Ended |
+| `cancelled` | Cancelled Call |
+| `rejected` | Rejected Call |
+| `unanswered` | Unanswered Call |
+| `busy` | Missed Call |
+
+**Received:**
+
+| Call status | Text |
+| --- | --- |
+| `initiated` | Incoming Call |
+| `ongoing` | Answered Call |
+| `ended` | Call Ended |
+| `unanswered` / `cancelled` | Missed Call |
+| `busy` | Busy Call |
+| `rejected` | Rejected Call |
+
+All text is localized.
+
+### Status Icon
+
+| Condition | Icon class |
+| --- | --- |
+| Missed (received `busy` / `unanswered` / `cancelled`) | `--missed-video` / `--missed-audio` |
+| Ended | `--call-ended` |
+| Sent by me (other statuses) | `--outgoing-video` / `--outgoing-audio` |
+| Received (other statuses) | `--incoming-video` / `--incoming-audio` |
+
+Missed calls additionally render in the error (red) color. Icons are rendered via CSS `mask-image` — override the mask in your own CSS to use custom icons.
+
+---
+
+## Props
+
+### message
+
+The call message (audio/video) in the `call` category. The bubble extracts the status, icon, and text from it. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.BaseMessage` |
+| Required | Yes |
+
+---
+
+### className
+
+Additional CSS class name applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+The bubble renders through the `CometChatActionBubble` primitive, so it uses the action-bubble selectors.
+
+| Target | Selector |
+| --- | --- |
+| Root container | `.cometchat-action-bubble` |
+| Icon element | `.cometchat-action-bubble__icon` |
+| Icon (error state) | `.cometchat-action-bubble__icon--error` |
+| Text element | `.cometchat-action-bubble__text` |
+| Text (error state) | `.cometchat-action-bubble__text--error` |
+| Missed video icon | `.cometchat-action-bubble__icon--missed-video` |
+| Missed audio icon | `.cometchat-action-bubble__icon--missed-audio` |
+| Outgoing video icon | `.cometchat-action-bubble__icon--outgoing-video` |
+| Outgoing audio icon | `.cometchat-action-bubble__icon--outgoing-audio` |
+| Incoming video icon | `.cometchat-action-bubble__icon--incoming-video` |
+| Incoming audio icon | `.cometchat-action-bubble__icon--incoming-audio` |
+| Call ended icon | `.cometchat-action-bubble__icon--call-ended` |
+
+Override a specific icon's mask:
+
+```css
+.cometchat-action-bubble__icon--missed-video {
+ -webkit-mask-image: url('/my-custom-missed-video.svg');
+ mask-image: url('/my-custom-missed-video.svg');
+}
+```
+
+---
+
+## Next Steps
+
+
+
+ How call status messages are resolved and rendered in the message list
+
+
+ System messages for group membership changes
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/components/call-bubble.mdx b/ui-kit/react/components/call-bubble.mdx
new file mode 100644
index 000000000..8a5bd8541
--- /dev/null
+++ b/ui-kit/react/components/call-bubble.mdx
@@ -0,0 +1,143 @@
+---
+title: "Call Bubble"
+sidebarTitle: "Call Bubble"
+description: "A self-extracting bubble for direct-call / meeting messages, with a call icon, title, timestamp, and a Join button."
+---
+
+
+```json
+{
+ "component": "CometChatCallBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatCallBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting call bubble for meeting / direct-call custom messages. Derives the call type, session ID, title, icon, and timestamp from the message.",
+ "cssRootClass": ".cometchat-call-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.BaseMessage", "required": true, "note": "The meeting/direct-call message; drives extraction." },
+ "alignment": { "type": "\"left\" | \"right\"", "note": "Defaults to sender-vs-logged-in-user." },
+ "onJoinClick": { "type": "(sessionId: string) => void" },
+ "className": { "type": "string" }
+ }
+ }
+}
+```
+
+
+## Overview
+
+`CometChatCallBubble` renders a direct-call / meeting message — a call icon, a title, a timestamp subtitle, and a **Join** button. It is **self-extracting**: pass the SDK `message` and the bubble derives the call type, session ID, title, icon, and timestamp itself, so it works standalone. Use `onJoinClick` to start the call when the user taps Join.
+
+
+**Live Preview** — interact with the call bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-call-bubble--audio-call-outgoing)
+
+
+
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCallBubble } from "@cometchat/chat-uikit-react";
+
+function MeetingMessage({ message }: { message: CometChat.BaseMessage }) {
+ return (
+ {
+ // Start / join the call session
+ }}
+ />
+ );
+}
+```
+
+---
+
+## Props
+
+### message
+
+The meeting / direct-call custom message. The bubble extracts the call type, session ID, title, icon, and timestamp from it. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.BaseMessage` |
+| Required | Yes |
+
+---
+
+### alignment
+
+Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.
+
+| | |
+| --- | --- |
+| Type | `"left" \| "right"` |
+| Default | derived |
+
+---
+
+### onJoinClick
+
+Callback when the Join button is clicked. Receives the session ID.
+
+| | |
+| --- | --- |
+| Type | `(sessionId: string) => void` |
+| Default | `undefined` |
+
+---
+
+### className
+
+Additional CSS class applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-call-bubble` |
+| Incoming / outgoing | `.cometchat-call-bubble-incoming` / `.cometchat-call-bubble-outgoing` |
+| Icon wrapper | `.cometchat-call-bubble__icon-wrapper` |
+| Title | `.cometchat-call-bubble__body-content-title` |
+| Subtitle | `.cometchat-call-bubble__body-content-subtitle` |
+| Join button | `.cometchat-call-bubble__button` |
+
+---
+
+## Next Steps
+
+
+
+ Call status system messages (missed, ended, etc.)
+
+
+ Browse call history and re-initiate calls
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/components/call-buttons.mdx b/ui-kit/react/components/call-buttons.mdx
new file mode 100644
index 000000000..33e323647
--- /dev/null
+++ b/ui-kit/react/components/call-buttons.mdx
@@ -0,0 +1,577 @@
+---
+title: "Call Buttons"
+description: "Voice and video call buttons for user or group conversations, with click overrides, custom button views, and full call lifecycle handling."
+---
+
+
+```json
+{
+ "component": "CometChatCallButtons",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatCallButtons } from \"@cometchat/chat-uikit-react\";",
+ "description": "Voice and video call initiation buttons for user or group conversations. Manages the full call lifecycle (outgoing + ongoing) internally.",
+ "cssRootClass": ".cometchat-call-buttons",
+ "primaryOutput": {
+ "description": "Initiates calls via the SDK and renders the outgoing/ongoing call screens"
+ },
+ "props": {
+ "data": {
+ "user": {
+ "type": "CometChat.User",
+ "default": "undefined",
+ "note": "Pass either user or group, not both"
+ },
+ "group": {
+ "type": "CometChat.Group",
+ "default": "undefined",
+ "note": "Pass either user or group, not both"
+ }
+ },
+ "callbacks": {
+ "onVoiceCallClick": "(entity: CometChat.User | CometChat.Group) => void",
+ "onVideoCallClick": "(entity: CometChat.User | CometChat.Group) => void",
+ "onCallEnded": "() => void",
+ "onError": "((error: CometChat.CometChatException) => void) | null"
+ },
+ "visibility": {
+ "hideVoiceCallButton": { "type": "boolean", "default": false },
+ "hideVideoCallButton": { "type": "boolean", "default": false }
+ },
+ "viewSlots": {
+ "voiceCallButtonView": "ReactNode",
+ "videoCallButtonView": "ReactNode"
+ },
+ "configuration": {
+ "callSettingsBuilder": "(isAudioOnlyCall: boolean, user?: CometChat.User, group?: CometChat.Group) => CallSettingsBuilder",
+ "className": "string"
+ }
+ },
+ "eventsEmitted": [
+ {
+ "name": "ui:call/outgoing",
+ "payload": "{ call }",
+ "description": "User initiates a 1-on-1 voice/video call"
+ },
+ {
+ "name": "ui:message/sent",
+ "payload": "{ message, status }",
+ "description": "Group call meeting message sent"
+ }
+ ],
+ "eventsReceived": [
+ {
+ "name": "ui:call/rejected",
+ "payload": "{ call }",
+ "description": "Re-enables call buttons after the call is rejected"
+ },
+ {
+ "name": "ui:call/ended",
+ "payload": "{}",
+ "description": "Resets all call state when the call ends"
+ }
+ ],
+ "sdkListeners": [
+ "onIncomingCallReceived",
+ "onIncomingCallCancelled",
+ "onOutgoingCallAccepted",
+ "onOutgoingCallRejected"
+ ],
+ "compositionExample": {
+ "description": "Standalone call buttons or embedded in the MessageHeader auxiliary view",
+ "components": ["CometChatCallButtons", "CometChatOutgoingCall", "CometChatOngoingCall"],
+ "flow": "user/group prop -> click button -> SDK initiateCall -> CometChatOutgoingCall overlay -> onOutgoingCallAccepted -> CometChatOngoingCall"
+ }
+}
+```
+
+
+## Where It Fits
+
+`CometChatCallButtons` renders voice and video call buttons. Pass a `user` for 1-on-1 calls or a `group` for group calls. It is typically embedded in `CometChatMessageHeader`'s auxiliary view or used standalone. The component is self-contained: clicking a button initiates the call, renders `CometChatOutgoingCall` internally while waiting for an answer, transitions to `CometChatOngoingCall` on acceptance, and cleans up when the call ends.
+
+
+**Live Preview** — interact with the call buttons component.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-calls-cometchatcallbuttons--default)
+
+
+
+
+```tsx
+import { useState, useEffect } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function CallButtonsDemo() {
+ const [chatUser, setChatUser] = useState();
+
+ useEffect(() => {
+ CometChat.getUser("uid").then((user) => setChatUser(user));
+ }, []);
+
+ return chatUser ? : null;
+}
+
+export default CallButtonsDemo;
+```
+
+
+
+
+
+---
+
+## Minimal Render
+
+```tsx
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function CallButtonsMinimal({ chatUser }: { chatUser: CometChat.User }) {
+ return ;
+}
+```
+
+Root CSS class: `.cometchat-call-buttons`
+
+---
+
+## Actions and Events
+
+### Callback Props
+
+#### onVoiceCallClick
+
+Overrides the default voice call initiation behavior. When set, clicking the voice button invokes this callback (with the active `user` or `group` entity) instead of initiating a call via the SDK.
+
+```tsx
+import { useState, useEffect } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function CallButtonsVoiceOverride() {
+ const [chatUser, setChatUser] = useState();
+
+ useEffect(() => {
+ CometChat.getUser("uid").then((user) => setChatUser(user));
+ }, []);
+
+ return (
+ {
+ console.log("Custom voice call logic for", entity.getName());
+ }}
+ />
+ );
+}
+```
+
+#### onVideoCallClick
+
+Overrides the default video call initiation behavior.
+
+```tsx
+import { useState, useEffect } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function CallButtonsVideoOverride() {
+ const [chatUser, setChatUser] = useState();
+
+ useEffect(() => {
+ CometChat.getUser("uid").then((user) => setChatUser(user));
+ }, []);
+
+ return (
+ {
+ console.log("Custom video call logic for", entity.getName());
+ }}
+ />
+ );
+}
+```
+
+#### onCallEnded
+
+Fires after an ongoing call session ends and the component has reset its internal state.
+
+```tsx
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function CallButtonsWithEndHandler({ chatUser }: { chatUser: CometChat.User }) {
+ return (
+ {
+ console.log("Call ended");
+ }}
+ />
+ );
+}
+```
+
+#### onError
+
+Fires on internal errors during call initiation.
+
+```tsx
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+
+function CallButtonsWithError({ chatUser }: { chatUser: CometChat.User }) {
+ return (
+ {
+ console.error("CallButtons error:", error);
+ }}
+ />
+ );
+}
+```
+
+### Events Emitted
+
+UI events this component publishes during the call lifecycle:
+
+| Event | Payload | Fires when |
+| --- | --- | --- |
+| `ui:call/outgoing` | `{ call }` | A 1-on-1 voice/video call is initiated |
+| `ui:message/sent` | `{ message, status }` | A group call meeting message is sent |
+
+### Events Received
+
+UI events this component subscribes to (published by other components):
+
+| Event | Payload | Behavior |
+| --- | --- | --- |
+| `ui:call/rejected` | `{ call }` | Clears the active call and re-enables the buttons |
+| `ui:call/ended` | `{}` | Clears the active call and resets all call state |
+
+### SDK Listeners (Real-Time, Automatic)
+
+The component attaches SDK call listeners internally:
+
+| SDK Listener | Internal behavior |
+| --- | --- |
+| `onIncomingCallReceived` | Disables call buttons to prevent concurrent calls |
+| `onIncomingCallCancelled` | Re-enables call buttons |
+| `onOutgoingCallAccepted` | Transitions to the ongoing call screen |
+| `onOutgoingCallRejected` | Clears the active call and resets state |
+
+---
+
+## Call Settings
+
+Customize the calling experience via `callSettingsBuilder`. The builder is forwarded to the internal `CometChatOngoingCall` session.
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCallButtons, CometChatUIKitCalls } from "@cometchat/chat-uikit-react";
+
+function CallButtonsCustomSettings({ chatUser }: { chatUser: CometChat.User }) {
+ return (
+
+ new CometChatUIKitCalls.CallSettingsBuilder()
+ .enableDefaultLayout(true)
+ .setIsAudioOnlyCall(isAudioOnlyCall)
+ }
+ />
+ );
+}
+```
+
+---
+
+## Customization
+
+### Custom Button Views
+
+Use `voiceCallButtonView` and `videoCallButtonView` to replace the default buttons while keeping the component's call lifecycle behavior intact.
+
+```tsx
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function CallButtonsCustomViews({ chatUser }: { chatUser: CometChat.User }) {
+ return (
+ Voice}
+ videoCallButtonView={}
+ />
+ );
+}
+```
+
+| Slot | Type | Replaces |
+| --- | --- | --- |
+| `voiceCallButtonView` | `ReactNode` | Default voice call button |
+| `videoCallButtonView` | `ReactNode` | Default video call button |
+
+---
+
+## Common Patterns
+
+### Voice-only call button
+
+```tsx
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function VoiceOnlyCallButtons({ chatUser }: { chatUser: CometChat.User }) {
+ return ;
+}
+```
+
+### Group call buttons
+
+```tsx
+import { useState, useEffect } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCallButtons } from "@cometchat/chat-uikit-react";
+
+function GroupCallButtons() {
+ const [group, setGroup] = useState();
+
+ useEffect(() => {
+ CometChat.getGroup("guid").then((g) => setGroup(g));
+ }, []);
+
+ return group ? : null;
+}
+```
+
+---
+
+## CSS Architecture
+
+The component uses CSS custom properties (design tokens) provided by the UI Kit. The cascade:
+
+1. Global tokens set on the `.cometchat` root wrapper.
+2. Component CSS (`.cometchat-call-buttons`) consumes these tokens via `var()`.
+3. Overrides target `.cometchat-call-buttons` descendant selectors.
+
+### Key Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-call-buttons` |
+| Button element | `.cometchat-call-buttons__button` |
+| Button icon | `.cometchat-call-buttons__button-icon` |
+| Voice button icon | `.cometchat-call-buttons__button-icon--voice` |
+| Video button icon | `.cometchat-call-buttons__button-icon--video` |
+
+### Example: Themed call buttons
+
+
+
+
+
+```css
+.cometchat-call-buttons {
+ display: flex;
+ padding: 8px 16px;
+ justify-content: center;
+ align-items: center;
+ gap: 4px;
+ background: #fff;
+}
+
+.cometchat-call-buttons__button {
+ border-radius: 8px;
+ border: 1px solid #e8e8e8;
+ background: #edeafa;
+}
+
+.cometchat-call-buttons__button-icon--voice,
+.cometchat-call-buttons__button-icon--video {
+ background-color: #6852d6;
+}
+```
+
+### Customization Matrix
+
+| What to change | Where | Property/API | Example |
+| --- | --- | --- | --- |
+| Override call initiation | Component props | `onVoiceCallClick` / `onVideoCallClick` | `onVoiceCallClick={(entity) => customCall(entity)}` |
+| Hide a call button | Component props | `hideVoiceCallButton` / `hideVideoCallButton` | `hideVideoCallButton={true}` |
+| Replace a button view | Component props | `voiceCallButtonView` / `videoCallButtonView` | `voiceCallButtonView={}` |
+| Customize call settings | Component props | `callSettingsBuilder` | `callSettingsBuilder={(audio) => builder}` |
+| Change colors, fonts, spacing | Global CSS | Target `.cometchat-call-buttons` class | `.cometchat-call-buttons__button-icon { background: red; }` |
+
+---
+
+## Props
+
+All props are optional. Sorted alphabetically.
+
+### callSettingsBuilder
+
+Builder function for customizing the ongoing call settings.
+
+| | |
+| --- | --- |
+| Type | `(isAudioOnlyCall: boolean, user?: CometChat.User, group?: CometChat.Group) => CallSettingsBuilder` |
+| Default | `undefined` |
+
+---
+
+### className
+
+Additional CSS class name applied to the root container.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+### group
+
+The group for group call buttons. Pass either `user` or `group`, not both.
+
+| | |
+| --- | --- |
+| Type | `CometChat.Group` |
+| Default | `undefined` |
+
+---
+
+### hideVideoCallButton
+
+Hides the video call button.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### hideVoiceCallButton
+
+Hides the voice call button.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### onCallEnded
+
+Callback fired after an ongoing call ends and the component resets its state.
+
+| | |
+| --- | --- |
+| Type | `() => void` |
+| Default | `undefined` |
+
+---
+
+### onError
+
+Callback fired when the component encounters an error.
+
+| | |
+| --- | --- |
+| Type | `((error: CometChat.CometChatException) => void) \| null` |
+| Default | `undefined` |
+
+---
+
+### onVideoCallClick
+
+Overrides the default video call initiation. Receives the active `user` or `group` entity.
+
+| | |
+| --- | --- |
+| Type | `(entity: CometChat.User \| CometChat.Group) => void` |
+| Default | `undefined` |
+
+---
+
+### onVoiceCallClick
+
+Overrides the default voice call initiation. Receives the active `user` or `group` entity.
+
+| | |
+| --- | --- |
+| Type | `(entity: CometChat.User \| CometChat.Group) => void` |
+| Default | `undefined` |
+
+---
+
+### user
+
+The user for 1-on-1 call buttons. Pass either `user` or `group`, not both.
+
+| | |
+| --- | --- |
+| Type | `CometChat.User` |
+| Default | `undefined` |
+
+---
+
+### videoCallButtonView
+
+Custom view that replaces the default video call button.
+
+| | |
+| --- | --- |
+| Type | `ReactNode` |
+| Default | `undefined` |
+
+---
+
+### voiceCallButtonView
+
+Custom view that replaces the default voice call button.
+
+| | |
+| --- | --- |
+| Type | `ReactNode` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-call-buttons` |
+| Button element | `.cometchat-call-buttons__button` |
+| Button icon | `.cometchat-call-buttons__button-icon` |
+| Voice button icon | `.cometchat-call-buttons__button-icon--voice` |
+| Video button icon | `.cometchat-call-buttons__button-icon--video` |
+
+---
+
+## Next Steps
+
+
+
+ Customize the outgoing call screen shown while waiting for an answer
+
+
+ Handle incoming call notifications with accept/decline actions
+
+
+ Browse call history and re-initiate calls
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/v7/components/call-logs.mdx b/ui-kit/react/components/call-logs.mdx
similarity index 91%
rename from ui-kit/react/v7/components/call-logs.mdx
rename to ui-kit/react/components/call-logs.mdx
index 37cc424d8..5f30f2500 100644
--- a/ui-kit/react/v7/components/call-logs.mdx
+++ b/ui-kit/react/components/call-logs.mdx
@@ -9,7 +9,6 @@ description: "Scrollable list of call history with call details, duration, and t
"component": "CometChatCallLogs",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatCallLogs } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Scrollable list of call history with call details, duration, and the ability to initiate new calls.",
"cssRootClass": ".cometchat-call-logs",
"primaryOutput": {
@@ -143,10 +142,7 @@ function CallHistory() {
```tsx
import { useState } from "react";
-import {
- CometChatCallLogs,
- CometChatOutgoingCall,
-} from "@cometchat/chat-uikit-react";
+import { CometChatCallLogs } from "@cometchat/chat-uikit-react";
function CallsTab() {
const [selectedCall, setSelectedCall] = useState(null);
@@ -162,8 +158,11 @@ function CallsTab() {
}}
/>
-
- {selectedCall && }
+
+ {selectedCall && (
+ // Render your own details panel for the selected call log
+
{JSON.stringify(selectedCall, null, 2)}
+ )}
);
@@ -174,16 +173,17 @@ function CallsTab() {
## Filtering
-Pass a custom `callLogRequestBuilder` to control which call logs are fetched. The default fetches up to 30 call logs with category "call".
+Pass a custom `callLogRequestBuilder` to control which call logs are fetched. The default fetches up to 30 call logs with category "call". Refer to [CallLogRequestBuilder](/sdk/javascript/call-logs) for the full builder API.
```tsx
-import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatUIKitCalls } from "@cometchat/chat-uikit-react";
```
@@ -192,7 +192,8 @@ import { CometChat } from "@cometchat/chat-sdk-javascript";
| Recipe | Code |
| --- | --- |
-| Increase page size | `new CometChat.MessagesRequestBuilder().setLimit(50).setCategory("call")` |
+| Increase page size | `new CometChatUIKitCalls.CallLogRequestBuilder().setLimit(50).setCallCategory("call")` |
+| Calls with a specific user | `new CometChatUIKitCalls.CallLogRequestBuilder().setUid("uid").setAuthToken(authToken)` |
| Only missed calls | Custom filtering via `itemView` with conditional rendering |
---
@@ -474,13 +475,13 @@ Show the native scrollbar on the call logs list.
## Next Steps
-
+
Handle incoming call notifications with accept/decline actions
-
+
Display the outgoing call screen while waiting for the receiver to answer
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/components/collaborative-document-bubble.mdx b/ui-kit/react/components/collaborative-document-bubble.mdx
new file mode 100644
index 000000000..daeeef335
--- /dev/null
+++ b/ui-kit/react/components/collaborative-document-bubble.mdx
@@ -0,0 +1,149 @@
+---
+title: "Collaborative Document Bubble"
+sidebarTitle: "Collaborative Document Bubble"
+description: "A self-extracting bubble that renders a collaborative document card with a banner and an 'Open Document' button."
+---
+
+
+```json
+{
+ "component": "CometChatCollaborativeDocumentBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatCollaborativeDocumentBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting collaborative document bubble. Extracts the document URL from the message metadata and opens it on click.",
+ "cssRootClass": ".cometchat-collaborative-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.BaseMessage", "required": true, "note": "Drives extraction of the document URL." },
+ "alignment": { "type": "\"left\" | \"right\"", "note": "Defaults to sender-vs-logged-in-user." },
+ "onButtonClick": { "type": "(url: string) => void", "note": "Defaults to window.open." },
+ "disabled": { "type": "boolean", "default": false },
+ "className": { "type": "string" }
+ }
+ }
+}
+```
+
+
+## Overview
+
+`CometChatCollaborativeDocumentBubble` renders a collaborative document card — a banner image, a title, a subtitle, and an "Open Document" button. It is **self-extracting**: pass the SDK `message` and the bubble reads the document URL from the message's extension metadata (`@injected.extensions.document.document_url`), so it works standalone. Clicking the button opens the document (by default in a new window).
+
+
+**Live Preview** — interact with the collaborative document bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-message-bubble--collaborative-document-message)
+
+
+
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCollaborativeDocumentBubble } from "@cometchat/chat-uikit-react";
+
+function DocumentMessage({ message }: { message: CometChat.BaseMessage }) {
+ return ;
+}
+```
+
+---
+
+## Props
+
+### message
+
+The collaborative-document message. The bubble extracts the URL from its metadata. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.BaseMessage` |
+| Required | Yes |
+
+---
+
+### alignment
+
+Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.
+
+| | |
+| --- | --- |
+| Type | `"left" \| "right"` |
+| Default | derived |
+
+---
+
+### onButtonClick
+
+Click handler for the action button. Receives the document URL. Defaults to `window.open`.
+
+| | |
+| --- | --- |
+| Type | `(url: string) => void` |
+| Default | `window.open` |
+
+---
+
+### disabled
+
+Disable the action button (e.g. for a thread header preview).
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### className
+
+Additional CSS class applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-collaborative-bubble` |
+| Document modifier | `.cometchat-collaborative-bubble--document` |
+| Incoming / outgoing | `.cometchat-collaborative-bubble--incoming` / `.cometchat-collaborative-bubble--outgoing` |
+| Banner image | `.cometchat-collaborative-bubble__banner-image` |
+| Title | `.cometchat-collaborative-bubble__body-content-name` |
+| Subtitle | `.cometchat-collaborative-bubble__body-content-description` |
+| Open button | `.cometchat-collaborative-bubble__button` |
+
+---
+
+## Next Steps
+
+
+
+ Plugin behavior, context menu, and conversation preview
+
+
+ Render collaborative whiteboard messages
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/components/collaborative-whiteboard-bubble.mdx b/ui-kit/react/components/collaborative-whiteboard-bubble.mdx
new file mode 100644
index 000000000..7ad4dd731
--- /dev/null
+++ b/ui-kit/react/components/collaborative-whiteboard-bubble.mdx
@@ -0,0 +1,149 @@
+---
+title: "Collaborative Whiteboard Bubble"
+sidebarTitle: "Collaborative Whiteboard Bubble"
+description: "A self-extracting bubble that renders a collaborative whiteboard card with a banner and an 'Open Whiteboard' button."
+---
+
+
+```json
+{
+ "component": "CometChatCollaborativeWhiteboardBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatCollaborativeWhiteboardBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting collaborative whiteboard bubble. Extracts the board URL from the message metadata and opens it on click.",
+ "cssRootClass": ".cometchat-collaborative-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.BaseMessage", "required": true, "note": "Drives extraction of the board URL." },
+ "alignment": { "type": "\"left\" | \"right\"", "note": "Defaults to sender-vs-logged-in-user." },
+ "onButtonClick": { "type": "(url: string) => void", "note": "Defaults to window.open." },
+ "disabled": { "type": "boolean", "default": false },
+ "className": { "type": "string" }
+ }
+ }
+}
+```
+
+
+## Overview
+
+`CometChatCollaborativeWhiteboardBubble` renders a collaborative whiteboard card — a banner image, a title, a subtitle, and an "Open Whiteboard" button. It is **self-extracting**: pass the SDK `message` and the bubble reads the board URL from the message's extension metadata (`@injected.extensions.whiteboard.board_url`), so it works standalone. Clicking the button opens the whiteboard (by default in a new window).
+
+
+**Live Preview** — interact with the collaborative whiteboard bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-message-bubble--collaborative-whiteboard-message)
+
+
+
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatCollaborativeWhiteboardBubble } from "@cometchat/chat-uikit-react";
+
+function WhiteboardMessage({ message }: { message: CometChat.BaseMessage }) {
+ return ;
+}
+```
+
+---
+
+## Props
+
+### message
+
+The collaborative-whiteboard message. The bubble extracts the URL from its metadata. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.BaseMessage` |
+| Required | Yes |
+
+---
+
+### alignment
+
+Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.
+
+| | |
+| --- | --- |
+| Type | `"left" \| "right"` |
+| Default | derived |
+
+---
+
+### onButtonClick
+
+Click handler for the action button. Receives the board URL. Defaults to `window.open`.
+
+| | |
+| --- | --- |
+| Type | `(url: string) => void` |
+| Default | `window.open` |
+
+---
+
+### disabled
+
+Disable the action button (e.g. for a thread header preview).
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### className
+
+Additional CSS class applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-collaborative-bubble` |
+| Whiteboard modifier | `.cometchat-collaborative-bubble--whiteboard` |
+| Incoming / outgoing | `.cometchat-collaborative-bubble--incoming` / `.cometchat-collaborative-bubble--outgoing` |
+| Banner image | `.cometchat-collaborative-bubble__banner-image` |
+| Title | `.cometchat-collaborative-bubble__body-content-name` |
+| Subtitle | `.cometchat-collaborative-bubble__body-content-description` |
+| Open button | `.cometchat-collaborative-bubble__button` |
+
+---
+
+## Next Steps
+
+
+
+ Plugin behavior, context menu, and conversation preview
+
+
+ Render collaborative document messages
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/v7/components/conversations.mdx b/ui-kit/react/components/conversations.mdx
similarity index 93%
rename from ui-kit/react/v7/components/conversations.mdx
rename to ui-kit/react/components/conversations.mdx
index de328d2f4..37424cbd1 100644
--- a/ui-kit/react/v7/components/conversations.mdx
+++ b/ui-kit/react/components/conversations.mdx
@@ -9,7 +9,6 @@ description: "Scrollable list of recent one-on-one and group conversations for t
"component": "CometChatConversations",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatConversations } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Scrollable list of recent one-on-one and group conversations for the logged-in user with real-time updates.",
"cssRootClass": ".cometchat-conversations",
"primaryOutput": {
@@ -77,7 +76,8 @@ description: "Scrollable list of recent one-on-one and group conversations for t
"searchView": "ReactNode",
"loadingView": "ReactNode",
"emptyView": "ReactNode",
- "errorView": "ReactNode"
+ "errorView": "ReactNode",
+ "options": "(conversation: CometChat.Conversation) => CometChatConversationOption[]"
}
},
"events": [
@@ -244,7 +244,7 @@ function ChatApp() {
## Filtering
-Pass a `CometChat.ConversationsRequestBuilder` to `conversationsRequestBuilder` to control which conversations load. Pass the builder instance — not the result of `.build()`.
+Pass a `CometChat.ConversationsRequestBuilder` to `conversationsRequestBuilder` to control which conversations load. Pass the builder instance — not the result of `.build()`. Refer to [ConversationsRequestBuilder](/sdk/javascript/retrieve-conversations) for the full builder API.
```tsx
+#### options
+
+Replace the context menu / hover actions on each conversation item.
+
+Default:
+
+
+
+
+
+Customized:
+
+
+
+
+
+
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatConversations,
+ type CometChatConversationOption,
+} from "@cometchat/chat-uikit-react";
+
+function CustomOptionsConversations() {
+ const getOptions = (conversation: CometChat.Conversation): CometChatConversationOption[] => [
+ {
+ id: "delete",
+ title: "Delete",
+ onClick: (conv) => { /* delete logic */ },
+ },
+ {
+ id: "mute",
+ title: "Mute Notification",
+ onClick: (conv) => { /* mute logic */ },
+ },
+ {
+ id: "unread",
+ title: "Mark as Unread",
+ onClick: (conv) => { /* mark unread logic */ },
+ },
+ {
+ id: "block",
+ title: "Block",
+ onClick: (conv) => { /* block logic */ },
+ },
+ ];
+
+ return ;
+}
+```
+
+
+```css
+.cometchat-conversations .cometchat-menu-list__main-menu-item-icon-delete {
+ background: red;
+}
+
+.cometchat-conversations .cometchat-menu-list__sub-menu {
+ background: transparent;
+ box-shadow: none;
+}
+```
+
+
+
### Compound Composition
For full layout control, use sub-components. Omit any sub-component to hide it:
@@ -1027,6 +1094,36 @@ Custom sound URL to play when new messages arrive (replaces the built-in sound).
---
+### options
+
+Function that returns context menu options for each conversation item (shown on hover/swipe).
+
+| | |
+| --- | --- |
+| Type | `(conversation: CometChat.Conversation) => CometChatConversationOption[]` |
+| Default | Default options (delete) |
+
+```tsx
+ [
+ {
+ id: "pin",
+ title: "Pin",
+ iconURL: pinIcon,
+ onClick: (conv) => pinConversation(conv),
+ },
+ {
+ id: "mute",
+ title: "Mute",
+ iconURL: muteIcon,
+ onClick: (conv) => muteConversation(conv),
+ },
+ ]}
+/>
+```
+
+---
+
### onItemClick
Callback when a conversation item is clicked.
@@ -1171,16 +1268,16 @@ Overrides survive component updates because the component never sets inline styl
## Next Steps
-
+
Browse and select users for new conversations
-
+
Display messages for the selected conversation
-
+
Search across conversations and messages
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/components/delete-bubble.mdx b/ui-kit/react/components/delete-bubble.mdx
new file mode 100644
index 000000000..87511df46
--- /dev/null
+++ b/ui-kit/react/components/delete-bubble.mdx
@@ -0,0 +1,117 @@
+---
+title: "Delete Bubble"
+sidebarTitle: "Delete Bubble"
+description: "A presentational bubble that renders a 'This message was deleted' placeholder."
+---
+
+
+```json
+{
+ "component": "CometChatDeleteBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatDeleteBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Presentational placeholder bubble for deleted messages.",
+ "cssRootClass": ".cometchat-delete-bubble",
+ "props": {
+ "data": {
+ "isSentByMe": { "type": "boolean", "note": "Affects sent vs received styling." },
+ "text": { "type": "string", "note": "Defaults to localized \"This message was deleted\"." },
+ "className": { "type": "string" }
+ }
+ }
+}
+```
+
+
+## Overview
+
+`CometChatDeleteBubble` renders the placeholder shown in place of a deleted message — italic, muted text reading "This message was deleted". It is a presentational component: pass `isSentByMe` for sent-vs-received styling and an optional `text` override. The [Delete Plugin](/ui-kit/react/plugins/overview#built-in-plugins) renders it automatically for any message whose `getDeletedAt()` is non-null.
+
+
+**Live Preview** — interact with the delete bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/base-elements-delete-bubble--default)
+
+
+
+
+---
+
+## Usage
+
+```tsx
+import { CometChatDeleteBubble } from "@cometchat/chat-uikit-react";
+
+function DeletedMessage() {
+ return ;
+}
+```
+
+---
+
+## Props
+
+### isSentByMe
+
+Whether the deleted message was sent by the logged-in user. Affects styling.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `undefined` |
+
+---
+
+### text
+
+Optional custom text override. Defaults to the localized "This message was deleted".
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | localized default |
+
+---
+
+### className
+
+Additional CSS class applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-delete-bubble` |
+| Sender / receiver | `.cometchat-delete-bubble--sender` / `.cometchat-delete-bubble--receiver` |
+| Icon | `.cometchat-delete-bubble__icon` |
+| Placeholder text | `.cometchat-delete-bubble__text` |
+
+---
+
+## Next Steps
+
+
+
+ How deleted messages are resolved and rendered
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/components/file-bubble.mdx b/ui-kit/react/components/file-bubble.mdx
new file mode 100644
index 000000000..eef4c8d72
--- /dev/null
+++ b/ui-kit/react/components/file-bubble.mdx
@@ -0,0 +1,137 @@
+---
+title: "File Bubble"
+sidebarTitle: "File Bubble"
+description: "A self-extracting bubble that renders a file attachment with its name, size, type icon, and a download action."
+---
+
+
+```json
+{
+ "component": "CometChatFileBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatFileBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting file bubble. Extracts the file attachment (url, name, size, extension) and caption from a MediaMessage.",
+ "cssRootClass": ".cometchat-file-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.MediaMessage", "required": true, "note": "Drives extraction of the file attachment and caption." },
+ "alignment": { "type": "\"left\" | \"right\"", "note": "Defaults to sender-vs-logged-in-user." },
+ "textFormatters": { "type": "CometChatTextFormatter[]" },
+ "className": { "type": "string" }
+ }
+ }
+}
+```
+
+
+## Overview
+
+`CometChatFileBubble` renders a file attachment. It is **self-extracting**: pass the SDK `message` and the bubble derives the file's URL, name, size, and extension (plus any caption) itself, so it works standalone. It shows a type icon, the file name and size, and a download control.
+
+
+**Live Preview** — interact with the file bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-message-bubble-file--default)
+
+
+
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatFileBubble } from "@cometchat/chat-uikit-react";
+
+function FileMessage({ message }: { message: CometChat.MediaMessage }) {
+ return ;
+}
+```
+
+---
+
+## Props
+
+### message
+
+The file message. The bubble extracts the attachment (url, name, size, extension) and caption from it. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.MediaMessage` |
+| Required | Yes |
+
+---
+
+### alignment
+
+Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.
+
+| | |
+| --- | --- |
+| Type | `"left" \| "right"` |
+| Default | derived |
+
+---
+
+### textFormatters
+
+Text formatters applied to the extracted caption.
+
+| | |
+| --- | --- |
+| Type | `CometChatTextFormatter[]` |
+| Default | `undefined` |
+
+---
+
+### className
+
+Additional CSS class applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-file-bubble` |
+| Sender / receiver | `.cometchat-file-bubble--sender` / `.cometchat-file-bubble--receiver` |
+| Type icon | `.cometchat-file-bubble__icon` |
+| File name | `.cometchat-file-bubble__filename` |
+| File size | `.cometchat-file-bubble__filesize` |
+| Download | `.cometchat-file-bubble__download` |
+| Caption | `.cometchat-file-bubble__caption` |
+
+---
+
+## Next Steps
+
+
+
+ Plugin behavior, context menu, and conversation preview
+
+
+ Render audio attachments
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/components/flag-message-dialog.mdx b/ui-kit/react/components/flag-message-dialog.mdx
new file mode 100644
index 000000000..b5d5ef220
--- /dev/null
+++ b/ui-kit/react/components/flag-message-dialog.mdx
@@ -0,0 +1,376 @@
+---
+title: "Flag Message Dialog"
+sidebarTitle: "Flag Message Dialog"
+description: "A dialog for reporting inappropriate messages with reason selection, an optional remark, and submission handling."
+---
+
+
+```json
+{
+ "component": "CometChatFlagMessageDialog",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatFlagMessageDialog } from \"@cometchat/chat-uikit-react\";",
+ "description": "Dialog for reporting/flagging an inappropriate message. Fetches flag reasons from the SDK, captures an optional remark, and submits the report.",
+ "cssRootClass": ".cometchat-flag-message-dialog",
+ "primaryOutput": {
+ "prop": "onSubmit",
+ "type": "(messageId: string, reasonId: string, remark?: string) => Promise"
+ },
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.BaseMessage", "note": "Required. The message being flagged." },
+ "isOpen": { "type": "boolean", "note": "When provided, the dialog is controlled." }
+ },
+ "callbacks": {
+ "onSubmit": { "type": "(messageId: string, reasonId: string, remark?: string) => Promise", "note": "Return true to close, false to keep open and show an error." },
+ "onClose": { "type": "() => void" },
+ "onError": { "type": "((error: CometChat.CometChatException) => void) | null" }
+ },
+ "config": {
+ "closeOnOutsideClick": { "type": "boolean", "default": true },
+ "className": { "type": "string" }
+ }
+ },
+ "types": {
+ "CometChatFlagMessageDialogRootProps": "Root overlay props",
+ "CometChatFlagMessageDialogHeaderProps": "Header sub-component props",
+ "CometChatFlagMessageDialogReasonsProps": "Reasons list sub-component props",
+ "CometChatFlagMessageDialogRemarkProps": "Remark input sub-component props",
+ "CometChatFlagMessageDialogActionsProps": "Actions (cancel/submit) sub-component props",
+ "CometChatFlagMessageDialogContextValue": "Full context value"
+ }
+}
+```
+
+
+## Where It Fits
+
+`CometChatFlagMessageDialog` is a modal dialog that lets a user report an inappropriate message. When it opens, it fetches the available report reasons from the SDK (`CometChat.getFlagReasons`), renders them as a single-select list, captures an optional free-text remark, and—on submit—invokes your `onSubmit` handler with the message ID, the selected reason ID, and the remark.
+
+
+**Live Preview** — interact with the flag message dialog.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-misc-flag-message-dialog--default)
+
+
+
+
+Use it when a user chooses "Report" on a message. The parent owns the open state and decides what happens with the report inside `onSubmit` (e.g., calling a moderation backend).
+
+```tsx lines
+import { useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatFlagMessageDialog } from "@cometchat/chat-uikit-react";
+
+function FlagMessageExample({ message }: { message: CometChat.BaseMessage }) {
+ const [open, setOpen] = useState(false);
+
+ const handleSubmit = async (
+ messageId: string,
+ reasonId: string,
+ remark?: string
+ ) => {
+ // Report the message to your backend / moderation service.
+ console.log("Reporting", { messageId, reasonId, remark });
+ return true; // return false to keep the dialog open and show an error
+ };
+
+ return (
+ <>
+
+
+ setOpen(false)}
+ onSubmit={handleSubmit}
+ />
+ >
+ );
+}
+```
+
+## Minimal Render
+
+```tsx lines
+import { CometChatFlagMessageDialog } from "@cometchat/chat-uikit-react";
+
+function Demo({ message }) {
+ return ;
+}
+```
+
+Root CSS class: `.cometchat-flag-message-dialog`
+
+## Sub-Components
+
+`CometChatFlagMessageDialog` is a compound component with these sub-components:
+
+| Sub-Component | Purpose |
+| --- | --- |
+| `Root` | Overlay and context provider. Manages open/close state, focus trap, outside-click/Escape, reason fetching, and submission. Renders the default layout when no children are passed. |
+| `Header` | Title and subtitle. Defaults to a localized "Report a Message" heading. |
+| `Reasons` | Single-select list of report reasons fetched from the SDK. |
+| `Remark` | Optional free-text input with a character counter (default max 500). |
+| `Actions` | Cancel and submit (Report) buttons. |
+
+### Custom Layout
+
+Compose sub-components to customize the layout — for example, omit `Remark` to collect only a reason:
+
+```tsx lines
+ setOpen(false)}
+ onSubmit={handleSubmit}
+>
+
+
+
+
+
+```
+
+### Custom Header
+
+Pass `title`/`subtitle` for text changes, or `children` for fully custom header content:
+
+```tsx lines
+
+
+
+
Custom Report Header
+
This uses children instead of title/subtitle props.
+
+
+
+
+
+```
+
+Sub-component props:
+
+| Sub-component | Prop | Type | Default |
+| --- | --- | --- | --- |
+| `Header` | `title` | `string` | `"Report a Message"` (localized) |
+| `Header` | `subtitle` | `string` | Localized description |
+| `Remark` | `label` | `string` | `"Reason"` (localized) |
+| `Remark` | `placeholder` | `string` | Localized placeholder |
+| `Remark` | `maxLength` | `number` | `500` |
+| `Actions` | `cancelText` | `string` | `"Cancel"` (localized) |
+| `Actions` | `submitText` | `string` | `"Report"` (localized) |
+
+Every sub-component also accepts `children` (where applicable) and a `className`.
+
+## Actions and Events
+
+### Callback Props
+
+#### onSubmit
+
+Called when the user clicks Report with a reason selected. Receives the message ID, the selected reason ID, and the optional remark. Return `true` to close the dialog, or `false` to keep it open and show an inline error.
+
+```tsx lines
+ setOpen(false)}
+ onSubmit={async (messageId, reasonId, remark) => {
+ const ok = await reportToBackend({ messageId, reasonId, remark });
+ return ok;
+ }}
+/>
+```
+
+#### onClose
+
+Called when the dialog requests to close — via the cancel button, the Escape key, or an outside click. In controlled mode you own the open state, so update it here.
+
+```tsx lines
+ setOpen(false)}
+/>
+```
+
+#### onError
+
+Called when an SDK error occurs (e.g., while fetching reasons or during submission).
+
+```tsx lines
+ setOpen(false)}
+ onError={(error) => console.error("Flag message error:", error)}
+/>
+```
+
+## Behavior Details
+
+### Controlled vs Uncontrolled
+
+- **Controlled** — pass `isOpen` and `onClose`. You own the open state (recommended for most apps).
+- **Uncontrolled** — omit `isOpen`. The dialog manages its own internal open state and closes itself on cancel, Escape, outside click, or a successful submit.
+
+### Reason Fetching
+
+On open, the dialog calls `CometChat.getFlagReasons()` and renders the result as a single-select list. While loading, a loading state is shown. If the call fails, `onError` is invoked.
+
+### Remark
+
+The remark is optional. It is trimmed before submission, and an empty remark is passed as `undefined` to `onSubmit`. A character counter enforces `maxLength` (default 500).
+
+### Submission
+
+The submit button is disabled until a reason is selected. On submit:
+1. `onSubmit` is awaited.
+2. Returning `false` (or throwing) keeps the dialog open and shows an inline error banner.
+3. Returning `true` closes the dialog.
+
+### Focus & Keyboard
+
+The Root traps focus within the dialog while open, moves focus to the first focusable element on open, restores focus to the previously focused element on close, cycles focus with `Tab` / `Shift+Tab`, and closes on `Escape`.
+
+## CSS Architecture
+
+The component uses CSS custom properties provided by the UI Kit.
+
+### Key Selectors
+
+| Target | Selector |
+| --- | --- |
+| Backdrop | `.cometchat-flag-message-dialog__backdrop` |
+| Dialog container | `.cometchat-flag-message-dialog` |
+| Error banner | `.cometchat-flag-message-dialog__error` |
+| Header | `.cometchat-flag-message-dialog__header` |
+| Header title | `.cometchat-flag-message-dialog__header-title` |
+| Header subtitle | `.cometchat-flag-message-dialog__header-subtitle` |
+| Reasons list | `.cometchat-flag-message-dialog__reasons` |
+| Reason item | `.cometchat-flag-message-dialog__reason` |
+| Reason item (selected) | `.cometchat-flag-message-dialog__reason--selected` |
+| Reasons loading | `.cometchat-flag-message-dialog__reasons-loading` |
+| Remark wrapper | `.cometchat-flag-message-dialog__remark` |
+| Remark label | `.cometchat-flag-message-dialog__remark-label` |
+| Remark input | `.cometchat-flag-message-dialog__remark-input` |
+| Remark counter | `.cometchat-flag-message-dialog__remark-counter` |
+| Remark counter (at limit) | `.cometchat-flag-message-dialog__remark-counter--limit` |
+| Actions container | `.cometchat-flag-message-dialog__actions` |
+| Cancel button | `.cometchat-flag-message-dialog__actions-cancel` |
+| Submit button | `.cometchat-flag-message-dialog__actions-submit` |
+
+### Example: Custom styling
+
+```css lines title="App.css"
+.cometchat-flag-message-dialog {
+ --cometchat-background-color-01: #ffffff;
+ --cometchat-text-color-primary: #141414;
+}
+
+.cometchat-flag-message-dialog__reason--selected {
+ border-color: var(--my-brand-color);
+}
+
+.cometchat-flag-message-dialog__actions-submit {
+ background: var(--my-brand-color);
+}
+```
+
+## Props
+
+The `message` prop is required. All other props are optional. The props below belong to `Root` (and to the flat `CometChatFlagMessageDialog`, which forwards them).
+
+---
+
+### message
+
+The message being flagged. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.BaseMessage` |
+| Default | — |
+
+---
+
+### isOpen
+
+Whether the dialog is open. When provided, the component is controlled.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `undefined` (uncontrolled) |
+
+---
+
+### onClose
+
+Callback invoked when the dialog requests to close (outside click, Escape, or cancel).
+
+| | |
+| --- | --- |
+| Type | `() => void` |
+| Default | `undefined` |
+
+---
+
+### closeOnOutsideClick
+
+Whether clicking outside the dialog closes it.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `true` |
+
+---
+
+### onSubmit
+
+Custom submit handler. Receives the message ID, the selected reason ID, and the optional remark. Return `true` on success (the dialog closes) or `false` to keep it open and show an error.
+
+| | |
+| --- | --- |
+| Type | `(messageId: string, reasonId: string, remark?: string) => Promise` |
+| Default | `undefined` |
+
+---
+
+### onError
+
+Callback when an SDK error occurs.
+
+| | |
+| --- | --- |
+| Type | `((error: CometChat.CometChatException) => void) \| null` |
+| Default | `undefined` |
+
+---
+
+### className
+
+Additional CSS class applied to the dialog backdrop.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+## Accessibility
+
+- Root has `role="dialog"` with `aria-modal="true"`.
+- The dialog is labelled by its title (`aria-labelledby`) and described by its subtitle (`aria-describedby`).
+- Focus moves into the dialog on open and is restored to the previously focused element on close.
+- Focus is trapped within the dialog; `Tab` / `Shift+Tab` cycle through focusable elements.
+- `Escape` closes the dialog.
+- The error banner uses `role="alert"` with `aria-live="assertive"`.
diff --git a/ui-kit/react/components/group-action-bubble.mdx b/ui-kit/react/components/group-action-bubble.mdx
new file mode 100644
index 000000000..64b9882e5
--- /dev/null
+++ b/ui-kit/react/components/group-action-bubble.mdx
@@ -0,0 +1,132 @@
+---
+title: "Group Action Bubble"
+sidebarTitle: "Group Action Bubble"
+description: "A self-extracting bubble that renders group action system messages like 'Alice joined' and 'Bob was kicked' from an SDK group-action message."
+---
+
+
+```json
+{
+ "component": "CometChatGroupActionBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatGroupActionBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting bubble for group membership system messages. Derives the localized action text from the SDK group-action message.",
+ "cssRootClass": ".cometchat-action-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.BaseMessage", "required": true, "note": "The group-action message (member joined/left/added/kicked/banned/scope change). Drives all extraction." },
+ "className": { "type": "string", "default": "undefined", "note": "Additional CSS class for the root element" }
+ }
+ },
+ "rendersThrough": "CometChatActionBubble (base primitive)",
+ "usedBy": ["CometChatGroupActionPlugin"]
+}
+```
+
+
+## Overview
+
+`CometChatGroupActionBubble` renders a centered, pill-shaped group action system message — "Alice joined", "Admin kicked Bob", "Admin made Bob a moderator", etc. It is **self-extracting**: pass the SDK group-action message and the bubble derives the localized action text itself (via the shared action-text utility), reading the locale from hooks. This means it works standalone — no plugin required.
+
+It is the component the [Group Action Plugin](/ui-kit/react/plugins/overview#built-in-plugins) forwards to, and it renders through the presentational `CometChatActionBubble` base primitive. Group action bubbles have no icon and no sender attribution.
+
+
+**Live Preview** — interact with the group action bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-group-action-bubble--all-actions)
+
+
+
+
+> The component renders nothing if the derived action text is empty.
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatGroupActionBubble } from "@cometchat/chat-uikit-react";
+
+function GroupActionMessage({ message }: { message: CometChat.BaseMessage }) {
+ return ;
+}
+```
+
+---
+
+## Supported Actions
+
+The bubble derives localized text for each group membership change:
+
+| Action | Example text |
+| --- | --- |
+| Member joined | "Alice joined" |
+| Member left | "Bob left" |
+| Member kicked | "Admin kicked Bob" |
+| Member banned | "Admin banned Charlie" |
+| Member unbanned | "Admin unbanned Charlie" |
+| Scope changed | "Admin made Bob a moderator" |
+| Member added | "Admin added Dave" |
+
+---
+
+## Props
+
+### message
+
+The group-action message (member joined / left / added / kicked / banned / scope change). The bubble extracts the localized action text from it. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.BaseMessage` |
+| Required | Yes |
+
+---
+
+### className
+
+Additional CSS class name applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+The bubble renders through the `CometChatActionBubble` primitive, so it uses the action-bubble selectors.
+
+| Target | Selector |
+| --- | --- |
+| Root container | `.cometchat-action-bubble` |
+| Action text | `.cometchat-action-bubble__text` |
+
+---
+
+## Next Steps
+
+
+
+ How group membership messages are resolved and rendered in the message list
+
+
+ System messages for call status
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/v7/components/group-members.mdx b/ui-kit/react/components/group-members.mdx
similarity index 94%
rename from ui-kit/react/v7/components/group-members.mdx
rename to ui-kit/react/components/group-members.mdx
index 7230f929d..385e4febb 100644
--- a/ui-kit/react/v7/components/group-members.mdx
+++ b/ui-kit/react/components/group-members.mdx
@@ -9,7 +9,6 @@ description: "Scrollable list of members for a specific group with role-based ac
"component": "CometChatGroupMembers",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatGroupMembers } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Scrollable list of members for a specific group with role-based actions like kick, ban, and scope change.",
"cssRootClass": ".cometchat-group-members",
"primaryOutput": {
@@ -93,6 +92,11 @@ description: "Scrollable list of members for a specific group with role-based ac
"name": "ui:group/member-scope-changed",
"payload": "{ group: CometChat.Group, user: CometChat.User, newScope: string }",
"description": "Updates the member's scope/role display"
+ },
+ {
+ "name": "ui:group/ownership-changed",
+ "payload": "{ group: CometChat.Group, newOwner: CometChat.User, previousOwnerUid: string }",
+ "description": "Updates new owner's scope to owner and demotes previous owner to admin"
}
],
"sdkListeners": [
@@ -169,8 +173,8 @@ import { CometChatGroupMembers } from "@cometchat/chat-uikit-react";
function MemberList({ group }: { group: CometChat.Group }) {
return (
-
-
+
+
@@ -221,7 +225,7 @@ function GroupDetailsPanel({ group }: { group: CometChat.Group }) {
## Filtering
-Pass a `CometChat.GroupMembersRequestBuilder` to `groupMemberRequestBuilder` to control which members load. Pass the builder instance — not the result of `.build()`.
+Pass a `CometChat.GroupMembersRequestBuilder` to `groupMemberRequestBuilder` to control which members load. Pass the builder instance — not the result of `.build()`. Refer to [GroupMembersRequestBuilder](/sdk/javascript/retrieve-group-members) for the full builder API.
```tsx
-View slot props (`headerView`, `searchView`, `loadingView`, `emptyView`, `errorView`, `itemView`, `leadingView`, `titleView`, `subtitleView`, `trailingView`) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.
+View slot props (`headerView`, `loadingView`, `emptyView`, `errorView`, `itemView`, `leadingView`, `titleView`, `subtitleView`, `trailingView`) are convenience props available only on the flat API. The search input is the `SearchBar` sub-component (with a `placeholder` prop), not a view slot. In compound composition mode, use the corresponding sub-components directly.
---
@@ -906,16 +911,16 @@ Callback when the back button in the header is clicked.
## Next Steps
-
+
Browse and select groups
-
+
View and unban banned group members
-
+
Add new members to a group
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/v7/components/groups.mdx b/ui-kit/react/components/groups.mdx
similarity index 95%
rename from ui-kit/react/v7/components/groups.mdx
rename to ui-kit/react/components/groups.mdx
index faa878a6a..c9595f707 100644
--- a/ui-kit/react/v7/components/groups.mdx
+++ b/ui-kit/react/components/groups.mdx
@@ -9,7 +9,6 @@ description: "Searchable, scrollable list of groups with selection support and r
"component": "CometChatGroups",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatGroups } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Searchable, scrollable list of groups with selection support and real-time membership updates.",
"cssRootClass": ".cometchat-groups",
"primaryOutput": {
@@ -111,7 +110,7 @@ description: "Searchable, scrollable list of groups with selection support and r
},
{
"name": "ui:group/ownership-changed",
- "payload": "{ group: CometChat.Group }",
+ "payload": "{ group: CometChat.Group, newOwner: CometChat.User, previousOwnerUid: string }",
"description": "Updates the group"
}
],
@@ -237,7 +236,7 @@ function GroupChat() {
## Filtering
-Pass a `CometChat.GroupsRequestBuilder` to `groupsRequestBuilder` to control which groups load. Pass the builder instance — not the result of `.build()`.
+Pass a `CometChat.GroupsRequestBuilder` to `groupsRequestBuilder` to control which groups load. Pass the builder instance — not the result of `.build()`. Refer to [GroupsRequestBuilder](/sdk/javascript/retrieve-groups) for the full builder API.
```tsx
-View slot props (`headerView`, `searchView`, `loadingView`, `emptyView`, `errorView`, `itemView`, `leadingView`, `titleView`, `subtitleView`, `trailingView`) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.
+View slot props (`headerView`, `loadingView`, `emptyView`, `errorView`, `itemView`, `leadingView`, `titleView`, `subtitleView`, `trailingView`) are convenience props available only on the flat API. The search input is the `SearchBar` sub-component (with a `placeholder` prop), not a view slot. In compound composition mode, use the corresponding sub-components directly.
---
@@ -781,16 +780,16 @@ Callback when the group list is empty after the initial fetch completes.
## Next Steps
-
+
View and manage members of a group
-
+
View recent conversations including group chats
-
+
Display messages for the selected group
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/components/image-bubble.mdx b/ui-kit/react/components/image-bubble.mdx
new file mode 100644
index 000000000..31f9ea946
--- /dev/null
+++ b/ui-kit/react/components/image-bubble.mdx
@@ -0,0 +1,165 @@
+---
+title: "Image Bubble"
+sidebarTitle: "Image Bubble"
+description: "A self-extracting bubble that renders one or more image attachments with grid layouts, a caption, and a fullscreen viewer."
+---
+
+
+```json
+{
+ "component": "CometChatImageBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatImageBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Self-extracting image bubble. Extracts image attachments and caption from a MediaMessage; supports single/grid layouts and a fullscreen viewer.",
+ "cssRootClass": ".cometchat-image-bubble",
+ "selfExtracting": true,
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.MediaMessage", "required": true, "note": "Drives extraction of attachments and caption." },
+ "alignment": { "type": "\"left\" | \"right\"", "note": "Defaults to sender-vs-logged-in-user." },
+ "textFormatters": { "type": "CometChatTextFormatter[]" },
+ "placeholderImage": { "type": "string" },
+ "onImageClicked": { "type": "(attachment, index) => void" },
+ "className": { "type": "string" }
+ }
+ }
+}
+```
+
+
+## Overview
+
+`CometChatImageBubble` renders the image attachment(s) of a media message. It is **self-extracting**: pass the SDK `message` and the bubble derives its attachments, caption, and alignment itself, so it works standalone.
+
+It supports multiple images with automatic layouts (single, grid, 2×2, and an overflow tile for extra images) and opens a fullscreen viewer when an image is clicked.
+
+
+**Live Preview** — interact with the image bubble.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-message-bubble-image--default)
+
+
+
+
+---
+
+## Usage
+
+```tsx
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import { CometChatImageBubble } from "@cometchat/chat-uikit-react";
+
+function ImageMessage({ message }: { message: CometChat.MediaMessage }) {
+ return ;
+}
+```
+
+---
+
+## Props
+
+### message
+
+The image message. The bubble extracts its attachments and caption. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.MediaMessage` |
+| Required | Yes |
+
+---
+
+### alignment
+
+Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.
+
+| | |
+| --- | --- |
+| Type | `"left" \| "right"` |
+| Default | derived |
+
+---
+
+### textFormatters
+
+Text formatters for caption rendering (mentions, URLs).
+
+| | |
+| --- | --- |
+| Type | `CometChatTextFormatter[]` |
+| Default | `undefined` |
+
+---
+
+### placeholderImage
+
+Custom placeholder image URL shown while the image loads. Falls back to a default photo icon.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+### onImageClicked
+
+Fires when an image is clicked (in addition to opening the fullscreen viewer).
+
+| | |
+| --- | --- |
+| Type | `(attachment: CometChatImageBubbleAttachment, index: number) => void` |
+| Default | `undefined` |
+
+---
+
+### className
+
+Additional CSS class applied to the root element.
+
+| | |
+| --- | --- |
+| Type | `string` |
+| Default | `undefined` |
+
+---
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Root | `.cometchat-image-bubble` |
+| Incoming / outgoing | `.cometchat-image-bubble--incoming` / `.cometchat-image-bubble--outgoing` |
+| Single image | `.cometchat-image-bubble--single` |
+| Container | `.cometchat-image-bubble__container` |
+| Grid | `.cometchat-image-bubble__grid` |
+| Image | `.cometchat-image-bubble__image` |
+| Overflow overlay | `.cometchat-image-bubble__overflow-overlay` |
+| Placeholder | `.cometchat-image-bubble__placeholder` |
+| Caption | `.cometchat-image-bubble__caption` |
+
+---
+
+## Next Steps
+
+
+
+ Plugin behavior, context menu, and conversation preview
+
+
+ Render video attachments
+
+
+ The wrapper that hosts bubble content
+
+
+ Customize colors, fonts, and spacing
+
+
diff --git a/ui-kit/react/v7/components/incoming-call.mdx b/ui-kit/react/components/incoming-call.mdx
similarity index 96%
rename from ui-kit/react/v7/components/incoming-call.mdx
rename to ui-kit/react/components/incoming-call.mdx
index db57f429c..31ae55f5d 100644
--- a/ui-kit/react/v7/components/incoming-call.mdx
+++ b/ui-kit/react/components/incoming-call.mdx
@@ -9,7 +9,6 @@ description: "Displays an incoming call notification with caller info, accept/de
"component": "CometChatIncomingCall",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatIncomingCall } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Displays an incoming call notification with caller info, accept/decline buttons, and transitions to the ongoing call screen.",
"cssRootClass": ".cometchat-incoming-call",
"primaryOutput": {
@@ -100,7 +99,7 @@ The component handles:
> **Placement:** Render `CometChatIncomingCall` at your app's root level. It manages its own visibility internally and only appears when an incoming call is detected.
-> **Note:** In v7, `CallButtons` is not a standalone component — call button functionality is part of `CometChatMessageHeader`. Use `CometChatIncomingCall` separately to handle the incoming call notification flow.
+> **Note:** Call **initiation** buttons are provided by the standalone [`CometChatCallButtons`](/ui-kit/react/components/call-buttons) component (also rendered automatically inside `CometChatMessageHeader`). `CometChatIncomingCall` is separate — it handles the incoming call notification flow.
---
@@ -499,13 +498,13 @@ Additional CSS class name applied to the root element.
## Next Steps
-
+
Display the outgoing call screen while waiting for the receiver to answer
-
+
Browse call history and re-initiate calls
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/components/message-bubble.mdx b/ui-kit/react/components/message-bubble.mdx
new file mode 100644
index 000000000..ff35e8223
--- /dev/null
+++ b/ui-kit/react/components/message-bubble.mdx
@@ -0,0 +1,317 @@
+---
+title: "Message Bubble"
+description: "A shared wrapper component that renders all message types with common chrome — avatar, sender name, bubble background, timestamp, receipts, thread replies, and context menu."
+---
+
+
+```json
+{
+ "component": "CometChatMessageBubble",
+ "package": "@cometchat/chat-uikit-react",
+ "import": "import { CometChatMessageBubble } from \"@cometchat/chat-uikit-react\";",
+ "description": "Layout shell that wraps plugin-rendered bubble content with shared chrome — avatar, sender name, bubble background, timestamp, receipts, thread replies, reactions, and context menu.",
+ "cssRootClass": ".cometchat-message-bubble",
+ "props": {
+ "data": {
+ "message": { "type": "CometChat.BaseMessage", "required": true },
+ "alignment": { "type": "'left' | 'right' | 'center'", "required": true },
+ "contentView": { "type": "ReactNode", "required": true, "note": "Inner content from the plugin's renderBubble()." },
+ "group": { "type": "CometChat.Group" },
+ "options": { "type": "CometChatMessageOption[]" },
+ "quickOptionsCount": { "type": "number", "default": 2 }
+ },
+ "visibility": {
+ "hideAvatar": { "type": "boolean", "default": false },
+ "forceShowAvatar": { "type": "boolean", "default": false },
+ "hideSenderName": { "type": "boolean", "default": false },
+ "hideTimestamp": { "type": "boolean", "default": false },
+ "hideThreadView": { "type": "boolean", "default": false },
+ "hideReceipts": { "type": "boolean", "note": "Reads from GlobalConfig if not set." },
+ "showError": { "type": "boolean", "default": false },
+ "disableInteraction": { "type": "boolean", "default": false }
+ },
+ "config": {
+ "messageSentAtDateTimeFormat": { "type": "CometChatDateFormatConfig" },
+ "isSelected": { "type": "boolean" },
+ "ariaPosinset": { "type": "number" },
+ "ariaSetsize": { "type": "number" },
+ "className": { "type": "string" },
+ "setRef": { "type": "Ref" },
+ "includeBottomViewHeight": { "type": "boolean", "default": false },
+ "toggleOptionsVisibility": { "type": "boolean" }
+ },
+ "viewSlots": {
+ "leadingView": "((message) => ReactNode) | null",
+ "headerView": "((message) => ReactNode) | null",
+ "statusInfoView": "((message) => ReactNode) | null",
+ "footerView": "((message) => ReactNode) | null",
+ "threadView": "((message) => ReactNode) | null",
+ "replyView": "ReactNode | null",
+ "bottomView": "((message) => ReactNode) | null"
+ },
+ "callbacks": {
+ "onAvatarClick": "(user: CometChat.User) => void",
+ "onThreadRepliesClick": "(message: CometChat.BaseMessage) => void",
+ "onOptionClick": "(option: CometChatMessageOption, message: CometChat.BaseMessage) => void",
+ "onReactionChipClick": "(messageId: number, emoji: string) => void",
+ "onReactorClick": "(reaction: CometChat.Reaction, message: CometChat.BaseMessage) => void"
+ }
+ }
+}
+```
+
+
+## Where It Fits
+
+`CometChatMessageBubble` is the layout shell for every message in the message list. The plugin system's `renderBubble()` produces the inner content (text, image, video, etc.), and the bubble wraps it with shared chrome.
+
+
+**Live Preview** — interact with the message bubble component.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-bubbles-message-bubble--default)
+
+
+
+
+```tsx lines
+import {
+ CometChatMessageBubble,
+ CometChatTextBubble,
+} from "@cometchat/chat-uikit-react";
+
+function MessageItem({ message, alignment }) {
+ return (
+
+ }
+ />
+ );
+}
+```
+
+
+Message bubbles are **self-extracting**: each bubble takes the SDK `message` and derives its own content (text, attachments, caption, poll data, call info, action text), reading the logged-in user, theme, and locale from hooks. Pass just `message` to render a bubble standalone — no plugin or pre-extracted props required. `CometChatTextBubble` also accepts an optional `text` override so media bubbles can render captions through it.
+
+
+## Shared Chrome Elements
+
+| Element | When Shown | Source |
+| --- | --- | --- |
+| Avatar | Incoming + group + `!hideAvatar` | `message.getSender().getAvatar()` |
+| Sender name | Incoming + group + `!hideSenderName` | `message.getSender().getName()` |
+| Bubble background | Always | Type-specific: primary for outgoing, neutral for incoming |
+| Timestamp | `!hideTimestamp` | `message.getSentAt()` via `CometChatDate` |
+| Receipts | Outgoing + `!hideReceipts` | `message.getReadAt()` / `getDeliveredAt()` |
+| Edited indicator | `message.getEditedAt()` truthy | "(edited)" text |
+| Thread replies | `message.getReplyCount() > 0` + `!hideThreadView` | Reply count button |
+| Context menu | `options.length > 0` + `!disableInteraction` | Hover/click |
+
+## GlobalConfig Integration
+
+`hideReceipts` reads from `GlobalConfigContext` when the prop is not explicitly set:
+
+```tsx lines
+
+ {/* All bubbles hide receipts unless overridden */}
+ {/* This one shows receipts */}
+
+```
+
+## Props
+
+### message
+
+The SDK message object. **Required.**
+
+| | |
+| --- | --- |
+| Type | `CometChat.BaseMessage` |
+
+---
+
+### alignment
+
+Bubble alignment: `'left'` (incoming), `'right'` (outgoing), `'center'` (action).
+
+| | |
+| --- | --- |
+| Type | `'left' \| 'right' \| 'center'` |
+
+---
+
+### contentView
+
+The inner content from the plugin's `renderBubble()`. **Required.**
+
+| | |
+| --- | --- |
+| Type | `ReactNode` |
+
+---
+
+### group
+
+Group context. Enables avatar and sender name display.
+
+| | |
+| --- | --- |
+| Type | `CometChat.Group` |
+| Default | `undefined` |
+
+---
+
+### hideAvatar / hideSenderName / hideTimestamp / hideThreadView
+
+Per-bubble display controls. Not in GlobalConfig.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### hideReceipts
+
+Hide receipt indicators. Reads from GlobalConfig if not set.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `undefined` (falls back to GlobalConfig, then `false`) |
+
+---
+
+### showError
+
+Show error receipt icon instead of normal receipts.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### disableInteraction
+
+Disable hover options and keyboard interactions.
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### options
+
+Context menu options for this message (the hover/overflow actions).
+
+| | |
+| --- | --- |
+| Type | `CometChatMessageOption[]` |
+| Default | `undefined` |
+
+---
+
+### quickOptionsCount
+
+Number of quick options shown directly; the rest move to the overflow menu.
+
+| | |
+| --- | --- |
+| Type | `number` |
+| Default | `2` |
+
+---
+
+### forceShowAvatar
+
+Force-show the avatar for incoming messages even in 1:1 chats (used by agent chat).
+
+| | |
+| --- | --- |
+| Type | `boolean` |
+| Default | `false` |
+
+---
+
+### messageSentAtDateTimeFormat
+
+Override the date format for the sent-at timestamp shown beside the bubble.
+
+| | |
+| --- | --- |
+| Type | `CometChatDateFormatConfig` |
+| Default | `undefined` |
+
+---
+
+### View override props
+
+Render-prop overrides for each region of the bubble. Semantics for all of them: omit (`undefined`) to use the built-in default, pass `null` to suppress the region, or pass a function/node to override it.
+
+| Prop | Type | Overrides |
+| --- | --- | --- |
+| `leadingView` | `((message) => ReactNode) \| null` | Leading view (avatar area) |
+| `headerView` | `((message) => ReactNode) \| null` | Header view (sender name area) |
+| `statusInfoView` | `((message) => ReactNode) \| null` | Status info (timestamp + receipts) |
+| `footerView` | `((message) => ReactNode) \| null` | Footer (reactions area) |
+| `threadView` | `((message) => ReactNode) \| null` | Thread reply view |
+| `replyView` | `ReactNode \| null` | Reply preview (quoted message) above content |
+| `bottomView` | `((message) => ReactNode) \| null` | View below the bubble (e.g. moderation footer) |
+
+---
+
+### Callback props
+
+| Prop | Signature | Fires when |
+| --- | --- | --- |
+| `onAvatarClick` | `(user: CometChat.User) => void` | The avatar is clicked |
+| `onThreadRepliesClick` | `(message: CometChat.BaseMessage) => void` | The thread view is clicked |
+| `onOptionClick` | `(option: CometChatMessageOption, message: CometChat.BaseMessage) => void` | A context menu option is clicked |
+| `onReactionChipClick` | `(messageId: number, emoji: string) => void` | A reaction chip is clicked (toggle add/remove) |
+| `onReactorClick` | `(reaction: CometChat.Reaction, message: CometChat.BaseMessage) => void` | A reactor in the reaction list is clicked |
+
+---
+
+### Accessibility & advanced props
+
+| Prop | Type | Default | Description |
+| --- | --- | --- | --- |
+| `isSelected` | `boolean` | `false` | Whether this message is selected |
+| `ariaPosinset` | `number` | — | Position in the message list (1-indexed) |
+| `ariaSetsize` | `number` | — | Total messages in the list |
+| `className` | `string` | — | Additional CSS class on the root element |
+| `setRef` | `Ref` | — | Ref to the outermost wrapper div (`role="article"`) |
+| `includeBottomViewHeight` | `boolean` | `false` | Use `fit-content` height for the options toolbar (useful with a `bottomView`) |
+| `toggleOptionsVisibility` | `boolean` | `undefined` | Explicitly control options toolbar visibility (`true` = always, `false` = never, `undefined` = hover-based) |
+
+## CSS Selectors
+
+| Target | Selector |
+| --- | --- |
+| Wrapper | `.cometchat-message-bubble__wrapper` |
+| Outgoing wrapper | `.cometchat-message-bubble__wrapper--outgoing` |
+| Avatar area | `.cometchat-message-bubble__leading-view` |
+| Bubble container | `.cometchat-message-bubble` |
+| Incoming | `.cometchat-message-bubble-incoming` |
+| Outgoing | `.cometchat-message-bubble-outgoing` |
+| Action (center) | `.cometchat-message-bubble-action` |
+| Sender name | `.cometchat-message-bubble__sender-name` |
+| Body | `.cometchat-message-bubble__body` |
+| Content | `.cometchat-message-bubble__body-content-view` |
+| Status info | `.cometchat-message-bubble__body-status-info-view` |
+| Receipts | `.cometchat-receipts` |
+| Thread button | `.cometchat-message-bubble__thread-button` |
diff --git a/ui-kit/react/v7/components/message-composer.mdx b/ui-kit/react/components/message-composer.mdx
similarity index 98%
rename from ui-kit/react/v7/components/message-composer.mdx
rename to ui-kit/react/components/message-composer.mdx
index d4c815383..34312bb7c 100644
--- a/ui-kit/react/v7/components/message-composer.mdx
+++ b/ui-kit/react/components/message-composer.mdx
@@ -9,7 +9,6 @@ description: "Rich text input with attachments, emoji, voice recording, mentions
"component": "CometChatMessageComposer",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatMessageComposer } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Rich text input with attachments, emoji, voice recording, mentions, and formatting for sending messages.",
"cssRootClass": ".cometchat-message-composer",
"primaryOutput": {
@@ -337,7 +336,10 @@ function ComposerCustomAttachments({ chatUser }: { chatUser: CometChat.User }) {
return (
openPhotoPicker() },
+ { id: "file", title: "Document", iconURL: fileIcon, onClick: () => openFilePicker() },
+ ]}
/>
);
}
@@ -1120,13 +1122,13 @@ Called when a mention is selected from the suggestions list.
## Next Steps
-
+
Display messages for the selected conversation
-
+
Show threaded replies for a parent message
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/v7/components/message-header.mdx b/ui-kit/react/components/message-header.mdx
similarity index 96%
rename from ui-kit/react/v7/components/message-header.mdx
rename to ui-kit/react/components/message-header.mdx
index 4e805aee5..5a507f97f 100644
--- a/ui-kit/react/v7/components/message-header.mdx
+++ b/ui-kit/react/components/message-header.mdx
@@ -9,7 +9,6 @@ description: "Toolbar displaying conversation details with avatar, name, presenc
"component": "CometChatMessageHeader",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatMessageHeader } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Toolbar displaying conversation details with avatar, name, presence status, typing indicator, and call buttons.",
"cssRootClass": ".cometchat-message-header",
"primaryOutput": {
@@ -117,7 +116,7 @@ description: "Toolbar displaying conversation details with avatar, name, presenc
},
{
"name": "ui:group/ownership-changed",
- "payload": "{ group }",
+ "payload": "{ group: CometChat.Group, newOwner: CometChat.User, previousOwnerUid: string }",
"description": "Updates group member count"
},
{
@@ -322,7 +321,7 @@ UI events this component subscribes to (published by other components):
| `ui:group/member-banned` | `{ group, user, message }` | Updates group member count |
| `ui:group/left` | `{ group }` | Updates group member count |
| `ui:group/member-joined` | `{ joinedGroup }` | Updates group member count |
-| `ui:group/ownership-changed` | `{ group }` | Updates group member count |
+| `ui:group/ownership-changed` | `{ group, newOwner, previousOwnerUid }` | Updates group member count |
| `ui:group/member-scope-changed` | `{ group, user, newScope }` | Updates group member count |
### SDK Listeners (Automatic)
@@ -359,7 +358,9 @@ Use view props to replace sections of the default UI while keeping the component
| `trailingView` | `ReactNode` | Call buttons + overflow menu |
| `auxiliaryButtonView` | `ReactNode` | Auxiliary button area |
-#### itemView
+#### Custom item layout
+
+Combine `leadingView`, `titleView`, and `subtitleView` to fully replace the header's item area.
@@ -560,7 +561,7 @@ Override design tokens on the component selector:
All props are optional (but you need either `user` or `group` for the component to display anything).
-View slot props (`headerView`, `searchView`, `loadingView`, `emptyView`, `errorView`, `itemView`, `leadingView`, `titleView`, `subtitleView`, `trailingView`) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.
+View slot props (`leadingView`, `titleView`, `subtitleView`, `trailingView`, `auxiliaryButtonView`) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.
---
@@ -794,16 +795,16 @@ Callback when an SDK error occurs during call operations or other internal proce
## Next Steps
-
+
Display messages for the active conversation
-
+
Compose and send messages
-
+
Header for threaded message views
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/v7/components/message-information.mdx b/ui-kit/react/components/message-information.mdx
similarity index 86%
rename from ui-kit/react/v7/components/message-information.mdx
rename to ui-kit/react/components/message-information.mdx
index 0d81be6a0..13aafd2e0 100644
--- a/ui-kit/react/v7/components/message-information.mdx
+++ b/ui-kit/react/components/message-information.mdx
@@ -9,7 +9,6 @@ description: "Displays detailed message information including delivery and read
"component": "CometChatMessageInformation",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatMessageInformation } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Displays detailed message information including delivery and read receipts for 1-on-1 and group conversations.",
"cssRootClass": ".cometchat-message-information",
"primaryOutput": {
@@ -19,9 +18,11 @@ description: "Displays detailed message information including delivery and read
"props": {
"data": {
"message": { "type": "CometChat.BaseMessage", "note": "Required. The message to show information for." },
- "dateTimeFormat": { "type": "CometChatMessageInformationCalendarObject", "note": "Custom date format for receipt timestamps." },
+ "messageInfoDateTimeFormat": { "type": "CometChatMessageInformationCalendarObject", "note": "Custom date format for receipt timestamps (read/delivered)." },
+ "messageSentAtDateTimeFormat": { "type": "CometChatMessageInformationCalendarObject", "note": "Format for the sent-at timestamp on the message bubble preview." },
"textFormatters": { "type": "CometChatTextFormatter[]", "note": "Text formatters for the message bubble preview." },
- "mockReceipts": { "type": "CometChatUserReceiptInfo[]", "note": "Mock receipts for Storybook/testing. Skips SDK fetch." }
+ "showScrollbar": { "type": "boolean", "default": false, "note": "Whether to show the scrollbar in the content area." },
+ "className": { "type": "string", "note": "Optional custom className for the root element." }
},
"callbacks": {
"onClose": { "type": "() => void", "note": "Called when the panel close button is clicked." },
@@ -72,7 +73,6 @@ It offers **two usage modes**:
```tsx
import { CometChatMessageInformation } from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/css-variables.css";
function MessageInfoPanel({ message, onClose }) {
return (
@@ -101,7 +101,6 @@ When using `` directly (without `.Root`), these a
```tsx
import { CometChatMessageInformation } from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/css-variables.css";
function MessageInfoPanel({ message, onClose }) {
return (
@@ -122,7 +121,6 @@ function MessageInfoPanel({ message, onClose }) {
```tsx
import { CometChatMessageInformation } from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/css-variables.css";
function Demo({ message }) {
return ;
@@ -137,7 +135,7 @@ Root CSS class: `.cometchat-message-information`
| Sub-Component | Purpose |
| --- | --- |
-| `Root` | Context provider. Accepts `message`, `onClose`, `onError`, `dateTimeFormat`, `textFormatters`, `showScrollbar`, `mockReceipts`. Renders default layout when no children provided. |
+| `Root` | Context provider. Accepts `message`, `onClose`, `onError`, `messageInfoDateTimeFormat`, `messageSentAtDateTimeFormat`, `textFormatters`, `showScrollbar`, `className`. Renders default layout when no children provided. |
| `Header` | Title ("Message Information") and close button. |
| `MessagePreview` | Message bubble preview area. |
| `ReceiptList` | Receipt display. Group: user list with avatars and timestamps. 1-on-1: Read/Delivered sections. |
@@ -165,10 +163,10 @@ Compose only the sub-components you need:
| `message` | `CometChat.BaseMessage` | — | **Required.** The message to show information for. |
| `onClose` | `() => void` | — | Called when the close button is clicked. |
| `onError` | `(error: unknown) => void` | — | Called when an SDK error occurs. |
-| `dateTimeFormat` | `CometChatMessageInformationCalendarObject` | `{ today: 'hh:mm A', ... }` | Custom date format for receipt timestamps. |
+| `messageInfoDateTimeFormat` | `CometChatMessageInformationCalendarObject` | `{ today: 'hh:mm A', ... }` | Custom date format for receipt timestamps (read/delivered). |
+| `messageSentAtDateTimeFormat` | `CometChatMessageInformationCalendarObject` | — | Format for the sent-at timestamp on the message bubble preview. |
| `textFormatters` | `CometChatTextFormatter[]` | `[]` | Text formatters for the message bubble preview. |
| `showScrollbar` | `boolean` | `false` | Whether to show the scrollbar in the content area. |
-| `mockReceipts` | `CometChatUserReceiptInfo[]` | — | Mock receipts for testing. Skips SDK fetch when provided. |
| `className` | `string` | — | Additional CSS class. |
## Keyboard Accessibility
diff --git a/ui-kit/react/v7/components/message-list.mdx b/ui-kit/react/components/message-list.mdx
similarity index 98%
rename from ui-kit/react/v7/components/message-list.mdx
rename to ui-kit/react/components/message-list.mdx
index 6f2f8294e..74d698780 100644
--- a/ui-kit/react/v7/components/message-list.mdx
+++ b/ui-kit/react/components/message-list.mdx
@@ -9,7 +9,6 @@ description: "Scrollable message feed with plugin-based bubble rendering, reacti
"component": "CometChatMessageList",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatMessageList } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Scrollable message feed with plugin-based bubble rendering, reactions, receipts, threads, and real-time updates.",
"cssRootClass": ".cometchat-message-list",
"primaryOutput": {
@@ -346,7 +345,7 @@ function ChatApp() {
## Filtering
-Pass a `CometChat.MessagesRequestBuilder` to `messagesRequestBuilder` to control which messages load. Pass the builder instance — not the result of `.build()`.
+Pass a `CometChat.MessagesRequestBuilder` to `messagesRequestBuilder` to control which messages load. Pass the builder instance — not the result of `.build()`. Refer to [MessagesRequestBuilder](/sdk/javascript/message-filtering) for the full builder API.
```tsx
-View slot props (`headerView`, `searchView`, `loadingView`, `emptyView`, `errorView`, `itemView`, `leadingView`, `titleView`, `subtitleView`, `trailingView`) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.
+View slot props (`bubbleView`, `headerView`, `footerView`, `loadingView`, `emptyView`, `errorView`) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.
---
@@ -1383,16 +1382,16 @@ Custom error state shown when message fetching fails.
## Next Steps
-
+
Add a composer below the message list for sending messages
-
+
Display thread context above a threaded message list
-
+
Learn how plugins register custom bubble renderers
-
+
Customize colors, fonts, and spacing
diff --git a/ui-kit/react/notification-feed.mdx b/ui-kit/react/components/notification-feed.mdx
similarity index 66%
rename from ui-kit/react/notification-feed.mdx
rename to ui-kit/react/components/notification-feed.mdx
index f963cfc39..79711463c 100644
--- a/ui-kit/react/notification-feed.mdx
+++ b/ui-kit/react/components/notification-feed.mdx
@@ -9,13 +9,11 @@ description: "Full-screen notification feed component with category filtering, c
"component": "CometChatNotificationFeed",
"package": "@cometchat/chat-uikit-react",
"import": "import { CometChatNotificationFeed } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
"description": "Full-screen notification feed with category filtering, timestamp grouping, card rendering via @cometchat/cards-react, real-time updates, and automatic engagement reporting.",
"cssRootClass": ".cometchat-notification-feed",
"props": {
"data": {
"title": { "type": "string", "default": "\"Notifications\"" },
- "scrollToItemId": { "type": "string", "default": "undefined", "note": "Deep link to a specific feed item" },
"notificationFeedRequestBuilder": { "type": "NotificationFeedRequestBuilder", "default": "SDK default (20 per page)" },
"notificationCategoriesRequestBuilder": { "type": "NotificationCategoriesRequestBuilder", "default": "SDK default (50 per page)" }
},
@@ -31,39 +29,15 @@ description: "Full-screen notification feed component with category filtering, c
"showFilterChips": { "type": "boolean", "default": true }
},
"viewSlots": {
- "headerView": "React.ReactNode",
- "emptyStateView": "React.ReactNode",
- "errorStateView": "React.ReactNode",
- "loadingStateView": "React.ReactNode"
+ "headerView": "ReactNode",
+ "emptyView": "ReactNode",
+ "errorView": "ReactNode",
+ "loadingView": "ReactNode",
+ "itemView": "(item: NotificationFeedItem) => ReactNode"
},
"cards": {
"cardThemeMode": { "type": "\"auto\" | \"light\" | \"dark\"", "default": "\"auto\"" },
- "cardThemeOverride": { "type": "Record", "default": "undefined" }
- },
- "style": {
- "type": "CometChatNotificationFeedStyle",
- "properties": {
- "backgroundColor": "string",
- "width": "string",
- "height": "string",
- "headerTitleColor": "string",
- "headerTitleFont": "string",
- "chipActiveBackgroundColor": "string",
- "chipActiveTextColor": "string",
- "chipInactiveBackgroundColor": "string",
- "chipInactiveTextColor": "string",
- "chipBorderColor": "string",
- "badgeBackgroundColor": "string",
- "badgeTextColor": "string",
- "separatorColor": "string",
- "timestampTextColor": "string",
- "timestampFont": "string",
- "cardBackgroundColor": "string",
- "cardBorderColor": "string",
- "cardBorderRadius": "number",
- "cardBorderWidth": "number",
- "unreadIndicatorColor": "string"
- }
+ "cardThemeOverride": { "type": "Record", "default": "undefined" }
}
},
"automaticBehaviors": [
@@ -74,11 +48,9 @@ description: "Full-screen notification feed component with category filtering, c
"Infinite scroll pagination",
"Timestamp grouping (Today, Yesterday, day name, date)",
"Category filter chips with unread badges",
- "Mark all read button",
- "Offline connectivity banner"
+ "Mark all read button"
],
"additionalExports": {
- "CometChatNotificationBadge": "Standalone unread count badge component",
"useNotificationUnreadCount": "Hook for tracking unread count with shared polling"
}
}
@@ -91,15 +63,29 @@ description: "Full-screen notification feed component with category filtering, c
+
+**Live Preview** — interact with the notification feed component.
+
+[Open in Storybook ↗](https://storybook.cometchat.io/react/?path=/story/components-notification-feed-cometchat-notification-feed--default)
+
+
+
+
---
## Where It Fits
`CometChatNotificationFeed` is a full-screen component. Drop it into a page or route. It manages its own data fetching, state, and real-time listeners — you just handle navigation callbacks.
-```tsx lines
+```tsx
import { CometChatNotificationFeed } from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/css-variables.css";
function NotificationsPage() {
return (
@@ -118,9 +104,8 @@ function NotificationsPage() {
## Minimal Render
-```tsx lines
+```tsx
import { CometChatNotificationFeed } from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/css-variables.css";
function NotificationsDemo() {
return (
@@ -143,7 +128,7 @@ Root CSS class: `.cometchat-notification-feed`
Control what loads using custom request builders:
-```tsx lines
+```tsx
import { CometChatNotificationFeed } from "@cometchat/chat-uikit-react";
import { CometChat } from "@cometchat/chat-sdk-javascript";
@@ -184,7 +169,7 @@ function UnreadNotifications() {
Fires when a feed item card is clicked.
-```tsx lines
+```tsx
{
console.log("Item clicked:", item.getId());
@@ -196,13 +181,13 @@ Fires when a feed item card is clicked.
Fires when an interactive element (button, link) inside a card is clicked. The `action` object contains the action type, parameters, and the element ID that triggered it.
-```tsx lines
+```tsx
{
const { type, params, elementId } = action;
switch (type) {
case "openUrl":
- window.open(params.url, "_blank");
+ window.open(params.url as string, "_blank");
break;
case "chatWithUser":
// Navigate to chat with params.uid
@@ -219,7 +204,7 @@ Fires when an interactive element (button, link) inside a card is clicked. The `
Fires when an internal error occurs (network failure, SDK exception).
-```tsx lines
+```tsx
{
console.error("Feed error:", error.message);
@@ -231,7 +216,7 @@ Fires when an internal error occurs (network failure, SDK exception).
Fires when the back button in the header is clicked.
-```tsx lines
+```tsx
window.history.back()}
@@ -252,108 +237,69 @@ The component handles these automatically — no manual setup needed:
| Timestamp grouping | Groups items as "Today", "Yesterday", day name, or date |
| Category filtering | Filter chips row with per-category unread badges |
| Mark all read | Header button to mark all notifications as read |
-| Offline banner | Shows connectivity warning when offline |
---
-## Custom View Slots
+## Customization
-### headerView
+### View Props
-Replace the entire header:
-
-```tsx lines
+```tsx
-
-
-
- }
- />
- );
-}
-```
-
-### Hide all chrome — minimal list
-
-```tsx lines
-import { CometChatConversations } from "@cometchat/chat-uikit-react";
-
-function MinimalConversations() {
- return (
-
- );
-}
-```
-
-### Conversations with search
-
-```tsx lines
-import { CometChatConversations } from "@cometchat/chat-uikit-react";
-
-function SearchableConversations() {
- return (
-
- );
-}
-```
-
----
-
-## CSS Architecture
-
-The component uses CSS custom properties (design tokens) defined in `@cometchat/chat-uikit-react/css-variables.css`. The cascade:
-
-1. Global tokens (e.g., `--cometchat-primary-color`, `--cometchat-background-color-01`) are set on the `.cometchat` root wrapper.
-2. Component CSS (`.cometchat-conversations`) consumes these tokens via `var()` with fallback values.
-3. Overrides target `.cometchat-conversations` descendant selectors in a global stylesheet.
-
-To scope overrides to a single instance when multiple `CometChatConversations` exist on the same page, wrap the component in a container and scope selectors:
-
-```css lines
-.sidebar-left .cometchat-conversations .cometchat-badge {
- background: #e5484d;
-}
-```
-
-Overrides survive component updates because the component never sets inline styles on these elements — all styling flows through CSS classes and custom properties.
-
-### Key Selectors
-
-| Target | Selector |
-| --- | --- |
-| Root | `.cometchat-conversations` |
-| Header title | `.cometchat-conversations .cometchat-list__header-title` |
-| List item | `.cometchat-conversations .cometchat-list-item` |
-| Body title | `.cometchat-conversations .cometchat-list-item__body-title` |
-| Avatar | `.cometchat-conversations .cometchat-avatar` |
-| Avatar text | `.cometchat-conversations .cometchat-avatar__text` |
-| Unread badge | `.cometchat-conversations .cometchat-badge` |
-| Subtitle text | `.cometchat-conversations .cometchat-conversations__subtitle-text` |
-| Status indicator | `.cometchat-conversations .cometchat-status-indicator` |
-| Read receipts | `.cometchat-conversations .cometchat-receipts-read` |
-| Active item | `.cometchat-conversations__list-item-active .cometchat-list-item` |
-| Typing indicator | `.cometchat-conversations__subtitle-typing` |
-| Trailing view | `.cometchat-conversations__trailing-view` |
-
-### Example: Brand-themed conversations
-
-
-
-
-
-```css lines
-.cometchat-conversations .cometchat-list-item__body-title,
-.cometchat-conversations .cometchat-list__header-title,
-.cometchat-conversations .cometchat-avatar__text,
-.cometchat-conversations .cometchat-badge,
-.cometchat-conversations .cometchat-conversations__subtitle-text {
- font-family: "SF Pro";
-}
-
-.cometchat-conversations .cometchat-list__header-title {
- background: #fef8f8;
- border-bottom: 2px solid #f4b6b8;
-}
-
-.cometchat-conversations .cometchat-avatar {
- background: #f0999b;
-}
-
-.cometchat-conversations .cometchat-status-indicator {
- min-width: 10px;
- height: 10px;
-}
-
-.cometchat-conversations .cometchat-badge {
- background: #e5484d;
-}
-
-.cometchat-conversations .cometchat-receipts-read {
- background: #e96b6f;
-}
-```
-
-### Customization Matrix
-
-| What to change | Where | Property/API | Example |
-| --- | --- | --- | --- |
-| Override behavior on user interaction | Component props | `on` callbacks | `onItemClick={(c) => setActive(c)}` |
-| Filter which conversations appear | Component props | `conversationsRequestBuilder` | `conversationsRequestBuilder={new CometChat.ConversationsRequestBuilder().setLimit(10)}` |
-| Toggle visibility of UI elements | Component props | `hide` boolean props | `hideReceipts={true}` |
-| Replace a section of the list item | Component props | `View` render props | `itemView={(conversation) =>
...
}` |
-| Change colors, fonts, spacing | Global CSS | Target `.cometchat-conversations` class | `.cometchat-conversations .cometchat-badge { background: #e5484d; }` |
-
----
-
-## Props
-
-All props are optional. Sorted alphabetically.
-
-### activeConversation
-
-Highlights the specified conversation in the list.
-
-| | |
-| --- | --- |
-| Type | `CometChat.Conversation` |
-| Default | `undefined` |
-
-Must be a reference-equal object from the SDK; a manually constructed object will not match.
-
----
-
-### conversationsRequestBuilder
-
-Controls which conversations load and in what order.
-
-| | |
-| --- | --- |
-| Type | `CometChat.ConversationsRequestBuilder` |
-| Default | SDK default (30 per page) |
-
-Pass the builder instance, not the result of `.build()`.
-
----
-
-### customSoundForMessages
-
-URL to a custom audio file for incoming message notifications.
-
-| | |
-| --- | --- |
-| Type | `string` |
-| Default | Built-in sound |
-
-Must be a valid audio URL accessible from the browser.
-
----
-
-### disableSoundForMessages
-
-Disables the notification sound for incoming messages.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### emptyView
-
-Custom component displayed when there are no conversations.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in empty state |
-
----
-
-### errorView
-
-Custom component displayed when an error occurs.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in error state |
-
-Hidden when `hideError={true}`.
-
----
-
-### headerView
-
-Custom component rendered as the entire header bar.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in header with title |
-
----
-
-### hideDeleteConversation
-
-Hides the delete option in the context menu.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### hideError
-
-Hides the default and custom error views.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
-Also suppresses `errorView` if set.
-
----
-
-### hideGroupType
-
-Hides the group type icon (public/private/password).
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### hideReceipts
-
-Hides message read/delivery receipt indicators.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### hideUserStatus
-
-Hides the online/offline status indicator.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### itemView
-
-Custom renderer for the entire list item row.
-
-| | |
-| --- | --- |
-| Type | `(conversation: CometChat.Conversation) => JSX.Element` |
-| Default | Built-in list item |
-
----
-
-### lastMessageDateTimeFormat
-
-Format for displaying the timestamp of the last message.
-
-| | |
-| --- | --- |
-| Type | `CalendarObject` |
-| Default | Component default (`hh:mm A` today, `[yesterday]`, `DD/MM/YYYY` other days) |
-
-```ts lines
-class CalendarObject {
- today?: string;
- yesterday?: string;
- lastWeek?: string;
- otherDays?: string;
- relativeTime?: {
- minute?: string;
- minutes?: string;
- hour?: string;
- hours?: string;
- };
-}
-```
-
-Falls back to [global calendar configuration](/ui-kit/react/localize#customisation) if not set.
-
----
-
-### leadingView
-
-Custom renderer for the avatar / left section.
-
-| | |
-| --- | --- |
-| Type | `(conversation: CometChat.Conversation) => JSX.Element` |
-| Default | Built-in avatar |
-
----
-
-### loadingView
-
-Custom component displayed during the loading state.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in shimmer |
-
----
-
-### onError
-
-Callback fired when the component encounters an error.
-
-| | |
-| --- | --- |
-| Type | `((error: CometChat.CometChatException) => void) \| null` |
-| Default | `undefined` |
-
----
-
-### onItemClick
-
-Callback fired when a conversation row is clicked.
-
-| | |
-| --- | --- |
-| Type | `(conversation: CometChat.Conversation) => void` |
-| Default | `undefined` |
-
----
-
-### onSearchBarClicked
-
-Callback fired when the search bar is clicked. Requires `showSearchBar={true}`.
-
-| | |
-| --- | --- |
-| Type | `() => void` |
-| Default | `undefined` |
-
----
-
-### onSelect
-
-Callback fired when a conversation is selected/deselected. Requires `selectionMode` to be set.
-
-| | |
-| --- | --- |
-| Type | `(conversation: CometChat.Conversation, selected: boolean) => void` |
-| Default | `undefined` |
-
----
-
-### options
-
-Custom context menu / hover actions for each conversation item.
-
-| | |
-| --- | --- |
-| Type | `((conversation: CometChat.Conversation) => CometChatOption[]) \| null` |
-| Default | Built-in delete option |
-
-```ts lines
-class CometChatOption {
- id?: string;
- title?: string;
- iconURL?: string;
- onClick?: () => void;
-}
-```
-
----
-
-### searchView
-
-Custom search bar component in the header.
-
-| | |
-| --- | --- |
-| Type | `JSX.Element` |
-| Default | Built-in search bar |
-
----
-
-### selectionMode
-
-Enables single or multi-select checkboxes on list items.
-
-| | |
-| --- | --- |
-| Type | `SelectionMode` |
-| Default | `SelectionMode.none` |
-
-```ts lines
-enum SelectionMode {
- single, // 0
- multiple, // 1
- none, // 2
-}
-```
-
-Must pair with `onSelect` to capture selections.
-
----
-
-### showScrollbar
-
-Shows the scrollbar in the conversation list.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### showSearchBar
-
-Shows a search bar at the top of the list.
-
-| | |
-| --- | --- |
-| Type | `boolean` |
-| Default | `false` |
-
----
-
-### subtitleView
-
-Custom renderer for the last message preview text.
-
-| | |
-| --- | --- |
-| Type | `(conversation: CometChat.Conversation) => JSX.Element` |
-| Default | Built-in subtitle |
-
----
-
-### textFormatters
-
-Custom text formatters for the conversation subtitle.
-
-| | |
-| --- | --- |
-| Type | `CometChatTextFormatter[]` |
-| Default | Default formatters from data source |
-
-See [CometChatMentionsFormatter](/ui-kit/react/mentions-formatter-guide) for mention formatting.
-
----
-
-### titleView
-
-Custom renderer for the name / title text.
-
-| | |
-| --- | --- |
-| Type | `(conversation: CometChat.Conversation) => JSX.Element` |
-| Default | Built-in title |
-
----
-
-### trailingView
-
-Custom renderer for the timestamp / badge / right section.
-
-| | |
-| --- | --- |
-| Type | `(conversation: CometChat.Conversation) => JSX.Element` |
-| Default | Built-in trailing view |
-
----
-
-## Events
-
-| Event | Payload | Fires when |
-| --- | --- | --- |
-| `CometChatConversationEvents.ccConversationDeleted` | `CometChat.Conversation` | Conversation deleted from list |
-| `CometChatConversationEvents.ccUpdateConversation` | `CometChat.Conversation` | Conversation updated |
-| `CometChatConversationEvents.ccMarkConversationAsRead` | `CometChat.Conversation` | Conversation marked as read |
-
-All events are `Subject` from RxJS. Subscribe with `.subscribe()`, unsubscribe with the returned subscription's `.unsubscribe()`.
-
----
-
-## CSS Selectors
-
-| Target | Selector |
-| --- | --- |
-| Root | `.cometchat-conversations` |
-| Header title | `.cometchat-conversations .cometchat-list__header-title` |
-| List item | `.cometchat-conversations .cometchat-list-item` |
-| Body title | `.cometchat-conversations .cometchat-list-item__body-title` |
-| Avatar | `.cometchat-conversations .cometchat-avatar` |
-| Avatar text | `.cometchat-conversations .cometchat-avatar__text` |
-| Unread badge | `.cometchat-conversations .cometchat-badge` |
-| Subtitle text | `.cometchat-conversations .cometchat-conversations__subtitle-text` |
-| Subtitle sender | `.cometchat-conversations__subtitle-text-sender` |
-| Status indicator (online) | `.cometchat-conversations__list-item-online .cometchat-list-item__status` |
-| Group type (password) | `.cometchat-conversations__list-item-password .cometchat-list-item__status` |
-| Group type (private) | `.cometchat-conversations__list-item-private .cometchat-list-item__status` |
-| Read receipts | `.cometchat-conversations__subtitle-receipts-read` |
-| Delivered receipts | `.cometchat-conversations__subtitle-receipts-delivered` |
-| Sent receipts | `.cometchat-conversations__subtitle-receipts-sent` |
-| Error receipts | `.cometchat-conversations__subtitle-receipts-error` |
-| Active item | `.cometchat-conversations__list-item-active .cometchat-list-item` |
-| Typing indicator | `.cometchat-conversations__subtitle-typing` |
-| Trailing view | `.cometchat-conversations__trailing-view` |
-| Badge count | `.cometchat-conversations__trailing-view-badge-count` |
-| Empty state | `.cometchat-conversations__empty-state-view` |
-| Error state | `.cometchat-conversations__error-state-view` |
-| Shimmer loading | `.cometchat-conversations__shimmer` |
-| Context menu | `.cometchat-conversations__trailing-view-options` |
-| Mentions highlight | `.cometchat-conversations__subtitle-text .cometchat-mentions` |
-| @you mentions | `.cometchat-conversations__subtitle-text .cometchat-mentions-you` |
diff --git a/ui-kit/react/core-features.mdx b/ui-kit/react/core-features.mdx
index d6f66ecba..b468b3c66 100644
--- a/ui-kit/react/core-features.mdx
+++ b/ui-kit/react/core-features.mdx
@@ -8,11 +8,11 @@ description: "Overview of CometChat React UI Kit core features, including messag
| Field | Value |
| --- | --- |
| Package | `@cometchat/chat-uikit-react` |
-| Required setup | `CometChatUIKit.init(UIKitSettings)` then `CometChatUIKit.login("UID")` — must complete before rendering any component |
+| Required setup | Wrap app in `CometChatProvider` with valid credentials — must complete before rendering any component |
| Core features | Instant Messaging, Media Sharing, Read Receipts, Mark as Unread, Typing Indicator, User Presence, Reactions, Mentions, Quoted Reply, Search, Threaded Conversations, Moderation, Report Message, Group Chat |
-| Key components | `CometChatConversations` → [Conversations](/ui-kit/react/conversations), `CometChatMessageList` → [Message List](/ui-kit/react/message-list), `CometChatMessageComposer` → [Message Composer](/ui-kit/react/message-composer), `CometChatMessageHeader` → [Message Header](/ui-kit/react/message-header), `CometChatUsers` → [Users](/ui-kit/react/users), `CometChatGroups` → [Groups](/ui-kit/react/groups), `CometChatGroupMembers` → [Group Members](/ui-kit/react/group-members) |
+| Key components | `CometChatConversations` → [Conversations](/ui-kit/react/components/conversations), `CometChatMessageList` → [Message List](/ui-kit/react/components/message-list), `CometChatMessageComposer` → [Message Composer](/ui-kit/react/components/message-composer), `CometChatMessageHeader` → [Message Header](/ui-kit/react/components/message-header), `CometChatUsers` → [Users](/ui-kit/react/components/users), `CometChatGroups` → [Groups](/ui-kit/react/components/groups), `CometChatGroupMembers` → [Group Members](/ui-kit/react/components/group-members) |
| CSS class prefix | `.cometchat-` |
-| Theming | Override CSS variables on `.cometchat` class. See [Theming](/ui-kit/react/theme) |
+| Theming | Override CSS variables on `.cometchat` class. See [Theming](/ui-kit/react/theming) |
@@ -28,8 +28,8 @@ At the heart of CometChat's functionality is the ability to support real-time te
| Components | Functionality |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
-| [Message Composer](/ui-kit/react/message-composer) | The [Message Composer](/ui-kit/react/message-composer) is a Component that enables users to write and send a variety of messages. |
-| [Message List](/ui-kit/react/message-list) | The [Message List](/ui-kit/react/message-list) is a Component that renders a list of messages sent and messages received using Text Bubble. |
+| [Message Composer](/ui-kit/react/components/message-composer) | The [Message Composer](/ui-kit/react/components/message-composer) is a Component that enables users to write and send a variety of messages. |
+| [Message List](/ui-kit/react/components/message-list) | The [Message List](/ui-kit/react/components/message-list) is a Component that renders a list of messages sent and messages received using Text Bubble. |
## Media Sharing
@@ -41,8 +41,8 @@ CometChat supports sharing images, videos, audio files, and documents within con
| Components | Functionality |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Message Composer](/ui-kit/react/message-composer) | The [Message Composer](/ui-kit/react/message-composer) component includes an ActionSheet. This ActionSheet serves as a menu appearing over the app's context, offering various options for sharing media files. |
-| [Message List](/ui-kit/react/message-list) | The [Message List](/ui-kit/react/message-list) component is responsible for rendering various Media Message bubbles, such as Image, File, Audio & Video Bubble. |
+| [Message Composer](/ui-kit/react/components/message-composer) | The [Message Composer](/ui-kit/react/components/message-composer) component includes an ActionSheet. This ActionSheet serves as a menu appearing over the app's context, offering various options for sharing media files. |
+| [Message List](/ui-kit/react/components/message-list) | The [Message List](/ui-kit/react/components/message-list) component is responsible for rendering various Media Message bubbles, such as Image, File, Audio & Video Bubble. |
## Read Receipts
@@ -54,8 +54,8 @@ CometChat's Read Receipts feature provides visibility into the message status, l
| Components | Functionality |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| [Conversations](/ui-kit/react/conversations) | [Conversations](/ui-kit/react/conversations) is a component that renders conversation list item. Conversation item also displays the delivery status of the last message providing users with real-time updates on the status of their messages. |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) is a component that renders different types of message bubbles. Read receipt status is an integral part of all message bubbles, no matter the type and provides real-time updates about the status of the message. |
+| [Conversations](/ui-kit/react/components/conversations) | [Conversations](/ui-kit/react/components/conversations) is a component that renders conversation list item. Conversation item also displays the delivery status of the last message providing users with real-time updates on the status of their messages. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) is a component that renders different types of message bubbles. Read receipt status is an integral part of all message bubbles, no matter the type and provides real-time updates about the status of the message. |
| Message Information | Message Information component provides transparency into the status of each sent message, giving the sender insights into whether their message has been delivered and read. |
## Mark as Unread
@@ -68,8 +68,8 @@ CometChat's Read Receipts feature provides visibility into the message status, l
| Components | Functionality |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) provides the "Mark as unread" option in message actions and supports starting from the first unread message when enabled. |
-| [Conversations](/ui-kit/react/conversations) | [Conversations](/ui-kit/react/conversations) component listens to conversation updates and reflects the updated unread count in real-time. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) provides the "Mark as unread" option in message actions and supports starting from the first unread message when enabled. |
+| [Conversations](/ui-kit/react/components/conversations) | [Conversations](/ui-kit/react/components/conversations) component listens to conversation updates and reflects the updated unread count in real-time. |
## Typing Indicator
@@ -81,8 +81,8 @@ The Typing Indicator feature in CometChat shows when a user is typing a response
| Components | Functionality |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Conversations](/ui-kit/react/conversations) | [Conversations](/ui-kit/react/conversations) is a component that renders conversation list item. Conversations item also shows real-time typing status indicators. This means that if a user in a one-on-one chat or a participant in a group chat is currently typing a message. |
-| [Message Header](/ui-kit/react/message-header) | [Message Header](/ui-kit/react/message-header) that renders details of User or Groups in ToolBar. The Message Header also handles the typing indicator functionality. When a user or a member in a group is typing, the Message Header dynamically updates to display a `typing...` status in real-time. |
+| [Conversations](/ui-kit/react/components/conversations) | [Conversations](/ui-kit/react/components/conversations) is a component that renders conversation list item. Conversations item also shows real-time typing status indicators. This means that if a user in a one-on-one chat or a participant in a group chat is currently typing a message. |
+| [Message Header](/ui-kit/react/components/message-header) | [Message Header](/ui-kit/react/components/message-header) that renders details of User or Groups in ToolBar. The Message Header also handles the typing indicator functionality. When a user or a member in a group is typing, the Message Header dynamically updates to display a `typing...` status in real-time. |
## User Presence
@@ -94,10 +94,10 @@ CometChat's User Presence feature allows users to see whether their contacts are
| Components | Functionality |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Conversations](/ui-kit/react/conversations) | [Conversations](/ui-kit/react/conversations) is a component that renders conversation list item. Conversations item also shows user presence information. |
-| [Message Header](/ui-kit/react/message-header) | [Message Header](/ui-kit/react/message-header) that renders details of user/group. The Message Header also handles user presence information. |
-| [Users](/ui-kit/react/users) | [Users](/ui-kit/react/users) renders the list of available users with presence information. |
-| [Group Members](/ui-kit/react/group-members) | [Group Members](/ui-kit/react/group-members) renders list of users available in the group. The Group Members component also handles user presence information. |
+| [Conversations](/ui-kit/react/components/conversations) | [Conversations](/ui-kit/react/components/conversations) is a component that renders conversation list item. Conversations item also shows user presence information. |
+| [Message Header](/ui-kit/react/components/message-header) | [Message Header](/ui-kit/react/components/message-header) that renders details of user/group. The Message Header also handles user presence information. |
+| [Users](/ui-kit/react/components/users) | [Users](/ui-kit/react/components/users) renders the list of available users with presence information. |
+| [Group Members](/ui-kit/react/components/group-members) | [Group Members](/ui-kit/react/components/group-members) renders list of users available in the group. The Group Members component also handles user presence information. |
## Reactions
@@ -109,7 +109,7 @@ CometChat's Reactions feature adds a layer of expressiveness to your chat applic
| Components | Functionality |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) is a component that renders different types of message bubbles. Reactions are an integral part and offer a more engaging, expressive way for users to respond to messages. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) is a component that renders different types of message bubbles. Reactions are an integral part and offer a more engaging, expressive way for users to respond to messages. |
## Mentions
@@ -121,9 +121,9 @@ Mentions is a robust feature provided by CometChat that enhances the interactivi
| Components | Functionality |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Conversations](/ui-kit/react/conversations) | [Conversations](/ui-kit/react/conversations) component provides an enhanced user experience by integrating the Mentions feature. This means that from the conversation list itself, users can see where they or someone else have been specifically mentioned. |
-| [Message Composer](/ui-kit/react/message-composer) | [Message Composer](/ui-kit/react/message-composer) is a component that allows users to craft and send various types of messages, including the usage of the mentions feature for direct addressing within the conversation. |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) is a component that displays a list of sent and received messages. It also supports the rendering of Mentions, enhancing the readability and interactivity of conversations. |
+| [Conversations](/ui-kit/react/components/conversations) | [Conversations](/ui-kit/react/components/conversations) component provides an enhanced user experience by integrating the Mentions feature. This means that from the conversation list itself, users can see where they or someone else have been specifically mentioned. |
+| [Message Composer](/ui-kit/react/components/message-composer) | [Message Composer](/ui-kit/react/components/message-composer) is a component that allows users to craft and send various types of messages, including the usage of the mentions feature for direct addressing within the conversation. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) is a component that displays a list of sent and received messages. It also supports the rendering of Mentions, enhancing the readability and interactivity of conversations. |
## Rich Text Formatting
@@ -135,8 +135,8 @@ Rich Text Formatting allows users to style their messages with bold, italic, und
| Components | Functionality |
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [CompactMessageComposer](/ui-kit/react/compact-message-composer) | [CompactMessageComposer](/ui-kit/react/compact-message-composer) provides a built-in rich text editor with formatting toolbar, floating selection toolbar, and keyboard shortcuts for bold, italic, underline, strikethrough, code, links, lists, and blockquotes. |
-| [MessageList](/ui-kit/react/message-list) | [MessageList](/ui-kit/react/message-list) renders formatted messages with the appropriate styling applied, displaying bold, italic, underline, strikethrough, code, links, lists, and blockquote formatting as intended by the sender. |
+| [Message Composer](/ui-kit/react/components/message-composer) | [Message Composer](/ui-kit/react/components/message-composer) with `enableRichTextEditor` provides a built-in rich text editor with formatting toolbar, floating selection toolbar, and keyboard shortcuts for bold, italic, underline, strikethrough, code, links, lists, and blockquotes. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) renders formatted messages with the appropriate styling applied, displaying bold, italic, underline, strikethrough, code, links, lists, and blockquote formatting as intended by the sender. |
## Threaded Conversations
@@ -160,8 +160,8 @@ Quoted Replies is a robust feature provided by CometChat that enables users to q
| Components | Functionality |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) supports replying to messages via the "Reply" option. Users can select "Reply" on a message to open the composer with the quoted reply pre-filled, maintaining context. |
-| [Message Composer](/ui-kit/react/message-composer) | [Message Composer](/ui-kit/react/message-composer) shows the quoted reply above the input field, providing context for the response. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) supports replying to messages via the "Reply" option. Users can select "Reply" on a message to open the composer with the quoted reply pre-filled, maintaining context. |
+| [Message Composer](/ui-kit/react/components/message-composer) | [Message Composer](/ui-kit/react/components/message-composer) shows the quoted reply above the input field, providing context for the response. |
## Group Chat
@@ -171,7 +171,7 @@ CometChat facilitates Group Chats, allowing users to have conversations with mul
-See the [Groups](/ui-kit/react/groups) component page for details.
+See the [Groups](/ui-kit/react/components/groups) component page for details.
## Moderation
@@ -187,7 +187,7 @@ Learn more about setting up moderation rules and managing content in the [Modera
| Components | Functionality |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) automatically handles moderated messages, displaying blocked content based on moderation settings. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) automatically handles moderated messages, displaying blocked content based on moderation settings. |
The **[Report Message](#report-message)** feature enables users to flag messages for review by moderators.
@@ -205,7 +205,7 @@ Learn more about how flagged messages are handled, reviewed, and moderated in th
| Components | Functionality |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) provides the "Report Message" option in the message actions menu, allowing users to initiate the reporting process for inappropriate messages. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) provides the "Report Message" option in the message actions menu, allowing users to initiate the reporting process for inappropriate messages. |
## Conversation and Advanced Search
@@ -217,12 +217,12 @@ Conversation and Advanced Search is a powerful feature provided by CometChat tha
| Components | Functionality |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [Search](/ui-kit/react/search) | [Search](/ui-kit/react/search) allows users to search across conversations and messages in real time. Users can click on a result to open the conversation or jump directly to a specific message. |
-| [Message Header](/ui-kit/react/message-header) | [Message Header](/ui-kit/react/message-header) shows the search button in the chat header, allowing users to search within a conversation. |
-| [Message List](/ui-kit/react/message-list) | [Message List](/ui-kit/react/message-list) shows the selected message when clicked from search results and highlights it in the message list. |
-| [Conversations](/ui-kit/react/conversations) | [Conversations](/ui-kit/react/conversations) displays the search input. |
+| [Search](/ui-kit/react/components/search) | [Search](/ui-kit/react/components/search) allows users to search across conversations and messages in real time. Users can click on a result to open the conversation or jump directly to a specific message. |
+| [Message Header](/ui-kit/react/components/message-header) | [Message Header](/ui-kit/react/components/message-header) shows the search button in the chat header, allowing users to search within a conversation. |
+| [Message List](/ui-kit/react/components/message-list) | [Message List](/ui-kit/react/components/message-list) shows the selected message when clicked from search results and highlights it in the message list. |
+| [Conversations](/ui-kit/react/components/conversations) | [Conversations](/ui-kit/react/components/conversations) displays the search input. |
-See the [Groups](/ui-kit/react/groups) component page for details.
+See the [Groups](/ui-kit/react/components/groups) component page for details.
---
@@ -232,7 +232,7 @@ See the [Groups](/ui-kit/react/groups) component page for details.
Browse all available UI Kit components
-
+
Customize the look and feel of your chat UI
diff --git a/ui-kit/react/custom-text-formatter-guide.mdx b/ui-kit/react/custom-text-formatter-guide.mdx
deleted file mode 100644
index 5411a5ec3..000000000
--- a/ui-kit/react/custom-text-formatter-guide.mdx
+++ /dev/null
@@ -1,397 +0,0 @@
----
-title: "Custom Text Formatter"
-description: "Extend the CometChatTextFormatter base class to implement custom inline text patterns with regex and callbacks."
----
-
-
-
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Key class | `CometChatTextFormatter` (abstract base class for custom formatters) |
-| Required setup | `CometChatUIKit.init(UIKitSettings)` then `CometChatUIKit.login("UID")` |
-| Purpose | Extend to create custom inline text patterns with regex, styling, and callbacks |
-| Features | Text formatting, customizable styles, dynamic text replacement, input field integration, key event callbacks |
-| Sample app | [GitHub](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) |
-| Related | [ShortCut Formatter](/ui-kit/react/shortcut-formatter-guide) \| [Mentions Formatter](/ui-kit/react/mentions-formatter-guide) \| [All Guides](/ui-kit/react/guide-overview) |
-
-
-
-`CometChatTextFormatter` is an abstract class for formatting text in the message composer and message bubbles. Extend it to build custom formatters — hashtags, keywords, or any regex-based pattern.
-
-| Capability | Description |
-| --- | --- |
-| Text formatting | Auto-format text based on regex patterns and styles |
-| Custom styles | Set colors, fonts, and backgrounds for matched text |
-| Dynamic replacement | Regex-based find-and-replace in user input |
-| Input integration | Real-time monitoring of the composer input field |
-| Key event callbacks | Hooks for `keyUp` and `keyDown` events |
-
-
-Always wrap formatted output in a `` with a unique CSS class (e.g. `"custom-hashtag"`). This tells the UI Kit to render it as-is instead of sanitizing it.
-
-
----
-
-## Steps
-
-### 1. Import the base class
-
-```javascript lines
-import { CometChatTextFormatter } from "@cometchat/chat-uikit-react";
-```
-
-### 2. Extend it
-
-```javascript lines
-class HashTagTextFormatter extends CometChatTextFormatter {
- ...
-}
-```
-
-### 3. Configure tracking character and regex
-
-Set the character that triggers formatting, the regex to match, and the regex to strip formatting back to plain text.
-
-```javascript lines
-this.setTrackingCharacter("#");
-this.setRegexPatterns([/\B#(\w+)\b/g]);
-this.setRegexToReplaceFormatting([
- /#(\w+)<\/span>/g,
-]);
-```
-
-### 4. Set key event callbacks
-
-```javascript lines
-this.setKeyUpCallBack(this.onKeyUp.bind(this));
-this.setKeyDownCallBack(this.onKeyDown.bind(this));
-```
-
-### 5. Implement formatting methods
-
-```typescript lines
-getFormattedText(inputText:string) { ... }
-getOriginalText(inputText:string) { ... }
-customLogicToFormatText(inputText: string) { ... }
-```
-
----
-
-## Example
-
-A hashtag formatter used with [CometChatMessageList](/ui-kit/react/message-list) and [CometChatMessageComposer](/ui-kit/react/message-composer).
-
-
-
-
-
-
-
-```ts lines
-import { CometChatTextFormatter } from "@cometchat/chat-uikit-react";
-
-class HashTagTextFormatter extends CometChatTextFormatter {
- constructor() {
- super();
- this.setTrackingCharacter("#");
- this.setRegexPatterns([/\B#(\w+)\b/g]);
- this.setRegexToReplaceFormatting([/#(\w+)/g]);
- this.setKeyUpCallBack(this.onKeyUp.bind(this));
- this.setKeyDownCallBack(this.onKeyDown.bind(this));
- this.setReRender(() => {
- console.log("Re-rendering message composer to update text content.");
- });
- this.initializeComposerTracking();
- }
-
- initializeComposerTracking() {
- const composerInput = document.getElementById("yourComposerInputId");
- this.setInputElementReference(composerInput);
- }
-
- getCaretPosition(): number {
- if (!this.inputElementReference) return 0;
- const selection = window.getSelection();
- if (!selection || selection.rangeCount === 0) return 0;
- const range = selection.getRangeAt(0);
- const clonedRange = range.cloneRange();
- clonedRange.selectNodeContents(this.inputElementReference);
- clonedRange.setEnd(range.endContainer, range.endOffset);
- return clonedRange.toString().length;
- }
-
- setCaretPosition(position: number) {
- if (!this.inputElementReference) return;
- const range = document.createRange();
- const selection = window.getSelection();
- if (!selection) return;
- range.setStart(
- this.inputElementReference.childNodes[0] || this.inputElementReference,
- position
- );
- range.collapse(true);
- selection.removeAllRanges();
- selection.addRange(range);
- }
-
- onKeyUp(event: KeyboardEvent) {
- if (event.key === this.trackCharacter) {
- this.startTracking = true;
- }
- if (this.startTracking && (event.key === " " || event.key === "Enter")) {
- const caretPosition = this.getCaretPosition();
- this.formatText();
- this.setCaretPosition(caretPosition);
- }
- if (
- this.startTracking &&
- event.key !== " " &&
- event.key !== "Enter" &&
- this.getCaretPosition() === this.inputElementReference?.innerText?.length
- ) {
- this.startTracking = false;
- }
- }
-
- formatText() {
- const inputValue =
- this.inputElementReference?.innerText ||
- this.inputElementReference?.textContent ||
- "";
- const formattedText = this.getFormattedText(inputValue);
- if (this.inputElementReference) {
- this.inputElementReference.innerHTML = formattedText || "";
- this.reRender();
- }
- }
-
- onKeyDown(event: KeyboardEvent) {}
-
- getFormattedText(inputText: string) {
- if (!inputText) return;
- return this.customLogicToFormatText(inputText);
- }
-
- customLogicToFormatText(inputText: string) {
- return inputText.replace(
- /\B#(\w+)\b/g,
- '#$1'
- );
- }
-
- getOriginalText(inputText: string) {
- if (!inputText) return "";
- for (let i = 0; i < this.regexToReplaceFormatting.length; i++) {
- let regexPattern = this.regexToReplaceFormatting[i];
- if (inputText) {
- inputText = inputText.replace(regexPattern, "#$1");
- }
- }
- return inputText;
- }
-}
-
-export default HashTagTextFormatter;
-```
-
-
-
-
-
-Pass the formatter via the `textFormatters` prop.
-
-```tsx lines
-import { HashTagTextFormatter } from "./HashTagTextFormatter";
-
-export default function MessageListDemo() {
- const [chatUser, setChatUser] = React.useState();
-
- React.useEffect(() => {
- CometChat.getUser("uid").then((user) => {
- setChatUser(user);
- })
- }, [])
-
- return (
-
- );
-}
-```
-
-
-
-
----
-
-## Methods Reference
-
-| Field | Setter | Description |
-| --- | --- | --- |
-| `trackCharacter` | `setTrackingCharacter(char)` | Character that starts tracking (e.g. `#` for hashtags) |
-| `currentCaretPosition` | `setCaretPositionAndRange(selection, range)` | Current selection set by the composer |
-| `currentRange` | `setCaretPositionAndRange(selection, range)` | Text range or cursor position set by the composer |
-| `inputElementReference` | `setInputElementReference(element)` | DOM reference to the composer input field |
-| `regexPatterns` | `setRegexPatterns(patterns)` | Regex patterns to match text for formatting |
-| `regexToReplaceFormatting` | `setRegexToReplaceFormatting(patterns)` | Regex patterns to strip formatting back to plain text |
-| `keyUpCallBack` | `setKeyUpCallBack(fn)` | Callback for key up events |
-| `keyDownCallBack` | `setKeyDownCallBack(fn)` | Callback for key down events |
-| `reRender` | `setReRender(fn)` | Triggers a re-render of the composer to update displayed text |
-| `loggedInUser` | `setLoggedInUser(user)` | Logged-in user object, set by composer and text bubbles |
-| `id` | `setId(id)` | Unique identifier for the formatter instance |
-
-
-Don't modify `textContent` or `innerHTML` of the input element directly. Call `reRender` instead — the composer will invoke `getFormattedText` for all formatters in order.
-
-
----
-
-## Override Methods
-
-
-
-
-Returns formatted HTML from input text, or edits at cursor position if `inputText` is null.
-
-```js lines
-getFormattedText(inputText: string | null, params: any): string | void {
- if (!inputText) {
- return; // edit at cursor position
- }
- return this.customLogicToFromatText(inputText);
-}
-```
-
-
-
-
-
-Handles `keyup` events. Start tracking when the track character is typed.
-
-```js lines
-onKeyUp(event: KeyboardEvent) {
- if (event.key == this.trackCharacter) {
- this.startTracking = true;
- }
- if (this.startTracking && event.key == " ") {
- this.debouncedFormatTextOnKeyUp();
- }
-}
-```
-
-
-
-
-
-Handles `keydown` events.
-
-```js lines
-onKeyDown(event: KeyboardEvent) {}
-```
-
-
-
-
-
-Called by the composer and text bubbles for each HTML element in the formatted string. Check for your formatter's CSS class before attaching listeners.
-
-```js lines
-registerEventListeners(element: HTMLElement, domTokenList: DOMTokenList) {
- let classList: string[] = Array.from(domTokenList);
- for (let i = 0; i < classList.length; i++) {
- if (classList[i] in this.mentionsCssClassMapping) {
- element.addEventListener("click", (event: Event) => {
- clearTimeout(this.timeoutID);
- CometChatUIEvents.ccMouseEvent.next({
- body: {
- CometChatUserGroupMembersObject:
- this.mentionsCssClassMapping[classList[i]],
- message: this.messageObject ?? null,
- id: this.getId(),
- },
- event,
- source: MouseEventSource.mentions,
- });
- });
-
- element.addEventListener("mouseover", (event: Event) => {
- this.timeoutID = setTimeout(() => {
- this.mouseOverEventDispatched = true;
- CometChatUIEvents.ccMouseEvent.next({
- body: {
- CometChatUserGroupMembersObject:
- this.mentionsCssClassMapping[classList[i]],
- message: this.messageObject ?? null,
- id: this.getId(),
- },
- event,
- source: MouseEventSource.mentions,
- });
- }, CometChatUtilityConstants.MentionsFormatter.MENTIONS_HOVER_TIMEOUT);
- });
-
- element.addEventListener("mouseout", (event: Event) => {
- clearTimeout(this.timeoutID);
- if (this.mouseOverEventDispatched) {
- CometChatUIEvents.ccMouseEvent.next({
- body: {
- CometChatUserGroupMembersObject:
- this.mentionsCssClassMapping[classList[i]],
- message: this.messageObject ?? null,
- id: this.getId(),
- },
- event,
- source: MouseEventSource.mentions,
- });
- this.mouseOverEventDispatched = false;
- }
- });
- }
- }
- return element;
-}
-```
-
-
-
-
-
-Strips formatting and returns plain text.
-
-```js lines
-getOriginalText(inputText: string | null | undefined): string {
- if (!inputText) return "";
- for (let i = 0; i < this.regexToReplaceFormatting.length; i++) {
- let regexPattern = this.regexToReplaceFormatting[i];
- if (inputText) {
- inputText = inputText.replace(regexPattern, "$1");
- }
- }
- return inputText;
-}
-```
-
-
-
-
----
-
-## Next Steps
-
-
-
- Add @mentions with styled tokens.
-
-
- Customize the message input component.
-
-
- Browse all feature and formatter guides.
-
-
- Full working sample application on GitHub.
-
-
diff --git a/ui-kit/react/v7/event-system.mdx b/ui-kit/react/event-system.mdx
similarity index 99%
rename from ui-kit/react/v7/event-system.mdx
rename to ui-kit/react/event-system.mdx
index 3e1d74699..d47424d8e 100644
--- a/ui-kit/react/v7/event-system.mdx
+++ b/ui-kit/react/event-system.mdx
@@ -222,7 +222,7 @@ These events are published by UI Kit components for local cross-component commun
| `ui:group/member-banned` | `{ message, user, group }` | GroupMembers |
| `ui:group/member-unbanned` | `{ message?, user, group }` | GroupMembers |
| `ui:group/member-scope-changed` | `{ message, user, group, newScope }` | GroupMembers |
-| `ui:group/ownership-changed` | `{ group, newOwner }` | GroupMembers |
+| `ui:group/ownership-changed` | `{ group, newOwner, previousOwnerUid }` | GroupMembers |
### Thread
diff --git a/ui-kit/react/events.mdx b/ui-kit/react/events.mdx
deleted file mode 100644
index b00bb4989..000000000
--- a/ui-kit/react/events.mdx
+++ /dev/null
@@ -1,98 +0,0 @@
----
-title: "Events"
-description: "Reference for CometChat React UI Kit events including conversation, user, group, message, and call events."
----
-
-
-
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Conversation events | `ccConversationDeleted`, `ccUpdateConversation` |
-| User events | `ccUserBlocked`, `ccUserUnblocked` |
-| Group events | `ccGroupCreated`, `ccGroupDeleted`, `ccGroupLeft`, `ccGroupMemberScopeChanged`, `ccGroupMemberKicked`, `ccGroupMemberBanned`, `ccGroupMemberUnbanned`, `ccGroupMemberJoined`, `ccGroupMemberAdded`, `ccOwnershipChanged` |
-| Message events | `ccMessageSent`, `ccMessageEdited`, `ccReplyToMessage`, `ccMessageDeleted`, `ccMessageRead`, `ccLiveReaction`, plus SDK listener events |
-| Call events | `ccOutgoingCall`, `ccCallAccepted`, `ccCallRejected`, `ccCallEnded` |
-| UI events | `ccActiveChatChanged` |
-| Purpose | Decoupled communication between UI Kit components — subscribe to events to react to changes without direct component references |
-
-
-
-Events provide decoupled communication between UI Kit components. Components emit events in response to user interactions or state changes, allowing other parts of the application to react without direct component references.
-
-### CometChatConversationEvents
-
-`CometChatConversationEvents` emits events when the logged-in user acts on a conversation object.
-
-| Name | Description |
-| ------------------------- | ------------------------------------------------------------------------------------------------ |
-| **ccConversationDeleted** | This event is triggered when the user successfully deletes a conversation. |
-| **ccUpdateConversation** | This event is triggered to update a conversation in the conversation list. Takes a Conversation object to update. |
-
-### CometChatUserEvents
-
-`CometChatUserEvents` emits events when the logged-in user acts on another user object.
-
-| Name | Description |
-| --------------- | ------------------------------------------------------------------------- |
-| **ccUserBlocked** | This event is triggered when the user successfully blocks another user. |
-| **ccUserUnblocked** | This event is triggered when the user successfully unblocks another user. |
-
-### CometChatGroupEvents
-
-`CometChatGroupEvents` emits events when the logged-in user acts on a group object.
-
-| Name | Description |
-| ------------------------- | ------------------------------------------------------------------------------------ |
-| **ccGroupCreated** | This event is triggered when the user creates a group successfully |
-| **ccGroupDeleted** | This event is triggered when the group member deletes the group successfully |
-| **ccGroupLeft** | This event is triggered when the group member leaves the group successfully |
-| **ccGroupMemberScopeChanged** | This event is triggered when the group member's scope is updated successfully |
-| **ccGroupMemberKicked** | This event is triggered when the group member is kicked |
-| **ccGroupMemberBanned** | This event is triggered when the group member is banned |
-| **ccGroupMemberUnbanned** | This event is triggered when the group member is un-banned |
-| **ccGroupMemberJoined** | This event is triggered when a user joins the group |
-| **ccGroupMemberAdded** | This event is triggered when a user is added to the group |
-| **ccOwnershipChanged** | This event is triggered when the group ownership is assigned to another group member |
-
-### CometChatMessageEvents
-
-`CometChatMessageEvents` emits events when the logged-in user acts on a message object.
-
-| Name | Description |
-| -------------------------- | --------------------------------------------------------------------------------------------------------- |
-| **ccMessageSent** | This event is triggered when the sent message is in transit and also when it is received by the receiver. |
-| **ccMessageEdited** | This event is triggered when the user successfully edits the message. |
-| **ccReplyToMessage** | This event is triggered when the user successfully replies to a message. |
-| **ccMessageDeleted** | This event is triggered when the user successfully deletes the message. |
-| **ccMessageRead** | This event is triggered when the sent message is read by the receiver. |
-| **ccLiveReaction** | This event is triggered when the user sends a live reaction. |
-| **onTextMessageReceived** | This event is emitted when the CometChat SDK listener emits a text message. |
-| **onMediaMessageReceived** | This event is emitted when the CometChat SDK listener emits a media message. |
-| **onCustomMessageReceived** | This event is emitted when the CometChat SDK listener emits a custom message. |
-| **onTypingStarted** | This event is emitted when the CometChat SDK listener indicates that a user has started typing. |
-| **onTypingEnded** | This event is emitted when the CometChat SDK listener indicates that a user has stopped typing. |
-| **onMessagesDelivered** | This event is emitted when the CometChat SDK listener indicates that messages have been delivered. |
-| **onMessagesRead** | This event is emitted when the CometChat SDK listener indicates that messages have been read. |
-| **onMessageEdited** | This event is emitted when the CometChat SDK listener indicates that a message has been edited. |
-| **onMessageDeleted** | This event is emitted when the CometChat SDK listener indicates that a message has been deleted. |
-| **onTransientMessageReceived** | This event is emitted when the CometChat SDK listener emits a transient message. |
-
-### CometChatCallEvents
-
-`CometChatCallEvents` emits events when the logged-in user acts on a call object.
-
-| Name | Description |
-| -------------- | ---------------------------------------------------------------------------- |
-| **ccOutgoingCall** | This event is triggered when the user initiates a voice/video call. |
-| **ccCallAccepted** | This event is triggered when the initiated call is accepted by the receiver. |
-| **ccCallRejected** | This event is triggered when the initiated call is rejected by the receiver. |
-| **ccCallEnded** | This event is triggered when the initiated call successfully ends. |
-
-### UI events
-
-UI events are triggered when a user interacts with UI Kit elements such as buttons, menus, or input fields.
-
-| Name | Description |
-| ------------------- | ---------------------------------------------------------------------------- |
-| **ccActiveChatChanged** | This event is triggered when the user navigates to a particular chat window. |
diff --git a/ui-kit/react/extensions.mdx b/ui-kit/react/extensions.mdx
index ebdf35e8e..e61f0b0f8 100644
--- a/ui-kit/react/extensions.mdx
+++ b/ui-kit/react/extensions.mdx
@@ -8,19 +8,19 @@ description: "Overview of CometChat extensions for React UI Kit, including engag
| Field | Value |
| --- | --- |
| Package | `@cometchat/chat-uikit-react` |
-| Required setup | `CometChatUIKit.init(UIKitSettings)` then `CometChatUIKit.login("UID")` + Extensions enabled in [CometChat Dashboard](/fundamentals/extensions-overview) |
+| Required setup | Wrap app in `CometChatProvider` with valid credentials + Extensions enabled in [CometChat Dashboard](/fundamentals/extensions-overview) |
| Extension categories | User Experience, User Engagement, Collaboration, Security, Customer Support, Smart Chat Features |
-| Key components | `CometChatMessageComposer` → [Message Composer](/ui-kit/react/message-composer) (Stickers, Polls, Whiteboard, Document), `CometChatMessageList` → [Message List](/ui-kit/react/message-list) (Translation, Link Preview, Thumbnails) |
+| Key components | `CometChatMessageComposer` → [Message Composer](/ui-kit/react/components/message-composer) (Stickers, Polls, Whiteboard, Document), `CometChatMessageList` → [Message List](/ui-kit/react/components/message-list) (Translation, Link Preview, Thumbnails) |
| Activation | Enable each extension from the CometChat Dashboard — UI Kit auto-integrates them, no additional code required |
## Overview
-CometChat UI Kit includes built-in support for extensions that add interactive, secure, and efficient features to chat. Extensions are activated from the [CometChat Dashboard](/fundamentals/extensions-overview) and auto-integrate into UI Kit components on init and login.
+CometChat UI Kit includes built-in support for extensions that add interactive, secure, and efficient features to chat. Extensions are activated from the [CometChat Dashboard](https://app.cometchat.com/) and auto-integrate into UI Kit components.
-Ensure `CometChatUIKit.init(UIKitSettings)` has completed and the user is logged in via `CometChatUIKit.login("UID")`. Extensions must be activated from the [CometChat Dashboard](/fundamentals/extensions-overview).
+Ensure your app is wrapped in `CometChatProvider` with valid credentials. Extensions must be activated from the [CometChat Dashboard](/fundamentals/extensions-overview).
## Built-in Extensions
@@ -37,7 +37,7 @@ Shortens long URLs in text messages using Bitly. See [Bitly Extension](/fundamen
Displays a summary (title, description, thumbnail) for URLs shared in chat. See [Link Preview Extension](/fundamentals/link-preview).
-Auto-integrates into the Message Bubble of [MessageList](/ui-kit/react/message-list) when activated.
+Auto-integrates into the Message Bubble of [MessageList](/ui-kit/react/components/message-list) when activated.
@@ -63,7 +63,7 @@ Bookmarks messages for later reference. Saved messages are private to the user.
Creates smaller preview images for shared images, reducing bandwidth. See [Thumbnail Generation Extension](/fundamentals/thumbnail-generation).
-Auto-integrates into the Message Bubble of [MessageList](/ui-kit/react/message-list) when activated.
+Auto-integrates into the Message Bubble of [MessageList](/ui-kit/react/components/message-list) when activated.
@@ -87,7 +87,7 @@ Search and share GIFs from Giphy. See [Giphy Extension](/fundamentals/giphy).
Translates messages into the local locale. See [Message Translation Extension](/fundamentals/message-translation).
-Auto-integrates into the Action Sheet of [MessageList](/ui-kit/react/message-list) when activated.
+Auto-integrates into the message options menu of [MessageList](/ui-kit/react/components/message-list) when activated.
@@ -97,7 +97,7 @@ Auto-integrates into the Action Sheet of [MessageList](/ui-kit/react/message-lis
Creates polls in group discussions with predefined answer options. See [Polls Extension](/fundamentals/polls).
-Auto-integrates into the Action Sheet of [Message Composer](/ui-kit/react/message-composer) when activated.
+Auto-integrates into the Action Sheet of [Message Composer](/ui-kit/react/components/message-composer) when activated.
@@ -111,7 +111,7 @@ Sets reminders for messages or creates personal reminders. A bot sends a notific
Sends pre-designed stickers in chat. See [Sticker Extension](/fundamentals/stickers).
-Auto-integrates into [Message Composer](/ui-kit/react/message-composer) when activated.
+Auto-integrates into [Message Composer](/ui-kit/react/components/message-composer) when activated.
@@ -131,7 +131,7 @@ Search and share GIFs from Tenor. See [Tenor Extension](/fundamentals/tenor).
Shared document editing for real-time collaboration. See [Collaborative Document Extension](/fundamentals/collaborative-document).
-Auto-integrates into the Action Sheet of [Message Composer](/ui-kit/react/message-composer) when activated.
+Auto-integrates into the Action Sheet of [Message Composer](/ui-kit/react/components/message-composer) when activated.
@@ -141,7 +141,7 @@ Auto-integrates into the Action Sheet of [Message Composer](/ui-kit/react/messag
Real-time shared whiteboard for drawing and brainstorming. See [Collaborative Whiteboard Extension](/fundamentals/collaborative-whiteboard).
-Auto-integrates into the Action Sheet of [Message Composer](/ui-kit/react/message-composer) when activated.
+Auto-integrates into the Action Sheet of [Message Composer](/ui-kit/react/components/message-composer) when activated.
@@ -182,10 +182,10 @@ AI-generated recap of long conversations. See [Conversation Summary](/fundamenta
## Next Steps
-
+
Customize the composer where most extensions appear
-
+
Customize the message list for extension-rendered content
diff --git a/ui-kit/react/group-members.mdx b/ui-kit/react/group-members.mdx
deleted file mode 100644
index d9ef73a8e..000000000
--- a/ui-kit/react/group-members.mdx
+++ /dev/null
@@ -1,1189 +0,0 @@
----
-title: "Group Members"
-description: "Scrollable, searchable list of members in a specific group with roles, scopes, online status, and member management actions."
----
-
-```json
-{
- "component": "CometChatGroupMembers",
- "package": "@cometchat/chat-uikit-react",
- "import": "import { CometChatGroupMembers } from \"@cometchat/chat-uikit-react\";",
- "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
- "description": "Scrollable, searchable list of members in a specific group with roles, scopes, online status, and member management actions.",
- "cssRootClass": ".cometchat-group-members",
- "primaryOutput": {
- "prop": "onItemClick",
- "type": "(groupMember: CometChat.GroupMember) => void"
- },
- "props": {
- "data": {
- "group": {
- "type": "CometChat.Group",
- "required": true,
- "note": "The group whose members are displayed"
- },
- "groupMemberRequestBuilder": {
- "type": "CometChat.GroupMembersRequestBuilder",
- "default": "SDK default (30 per page)",
- "note": "Pass the builder, not the result of .build()"
- },
- "searchRequestBuilder": {
- "type": "CometChat.GroupMembersRequestBuilder",
- "default": "undefined"
- },
- "searchKeyword": {
- "type": "string",
- "default": "\"\""
- }
- },
- "callbacks": {
- "onItemClick": "(groupMember: CometChat.GroupMember) => void",
- "onSelect": "(groupMember: CometChat.GroupMember, selected: boolean) => void",
- "onEmpty": "() => void",
- "onError": "((error: CometChat.CometChatException) => void) | null"
- },
- "visibility": {
- "hideSearch": { "type": "boolean", "default": false },
- "hideError": { "type": "boolean", "default": false },
- "hideKickMemberOption": { "type": "boolean", "default": false },
- "hideBanMemberOption": { "type": "boolean", "default": false },
- "hideScopeChangeOption": { "type": "boolean", "default": false },
- "hideUserStatus": { "type": "boolean", "default": false },
- "disableLoadingState": { "type": "boolean", "default": false },
- "showScrollbar": { "type": "boolean", "default": false }
- },
- "selection": {
- "selectionMode": {
- "type": "SelectionMode",
- "values": ["SelectionMode.single (0)", "SelectionMode.multiple (1)", "SelectionMode.none (2)"],
- "default": "SelectionMode.none"
- }
- },
- "viewSlots": {
- "itemView": "(groupMember: CometChat.GroupMember) => JSX.Element",
- "leadingView": "(groupMember: CometChat.GroupMember) => JSX.Element",
- "titleView": "(groupMember: CometChat.GroupMember) => JSX.Element",
- "subtitleView": "(groupMember: CometChat.GroupMember) => JSX.Element",
- "trailingView": "(groupMember: CometChat.GroupMember) => JSX.Element",
- "headerView": "JSX.Element",
- "loadingView": "JSX.Element",
- "emptyView": "JSX.Element",
- "errorView": "JSX.Element",
- "options": "(group: CometChat.Group, groupMember: CometChat.GroupMember) => CometChatOption[]"
- }
- },
- "events": [
- {
- "name": "CometChatGroupEvents.ccGroupMemberKicked",
- "payload": "IGroupMemberKickedBanned",
- "description": "Member kicked"
- },
- {
- "name": "CometChatGroupEvents.ccGroupMemberBanned",
- "payload": "IGroupMemberKickedBanned",
- "description": "Member banned"
- },
- {
- "name": "CometChatGroupEvents.ccGroupMemberScopeChanged",
- "payload": "IGroupMemberScopeChanged",
- "description": "Member scope changed"
- },
- {
- "name": "CometChatGroupEvents.ccGroupMemberAdded",
- "payload": "IGroupMemberAdded",
- "description": "Members added"
- }
- ],
- "sdkListeners": [
- "onGroupMemberScopeChanged",
- "onGroupMemberKicked",
- "onGroupMemberBanned",
- "onMemberAddedToGroup",
- "onGroupMemberLeft",
- "onGroupMemberJoined",
- "onUserOnline",
- "onUserOffline"
- ],
- "types": {
- "CometChatOption": {
- "id": "string | undefined",
- "title": "string | undefined",
- "iconURL": "string | undefined",
- "onClick": "(() => void) | undefined"
- },
- "SelectionMode": {
- "single": 0,
- "multiple": 1,
- "none": 2
- }
- }
-}
-```
-
-
-## Where It Fits
-
-`CometChatGroupMembers` is a panel component that renders the member list for a specific group. It requires a `group` prop and provides built-in member management actions (kick, ban, scope change) based on the logged-in user's role. Typically rendered alongside the message view in a group chat layout.
-
-```tsx lines
-import { useEffect, useState } from "react";
-import {
- CometChatGroupMembers,
- CometChatMessageHeader,
- CometChatMessageList,
- CometChatMessageComposer,
-} from "@cometchat/chat-uikit-react";
-import { CometChat } from "@cometchat/chat-sdk-javascript";
-import "@cometchat/chat-uikit-react/css-variables.css";
-
-function GroupChatWithMembers() {
- const [group, setGroup] = useState();
-
- useEffect(() => {
- CometChat.getGroup("GROUP_GUID").then(setGroup);
- }, []);
-
- if (!group) return null;
-
- return (
-
- );
-};
-```
-
-
----
-
-### 4. Add Members
-
-Let admins select users and add them to the group. Collect selected UIDs, call `CometChat.addMembersToGroup()`, and emit `ccGroupMemberAdded` so the member list refreshes.
-
-_File: [CometChatAddMembers.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatAddMembers/CometChatAddMembers.tsx)_
-
-```tsx lines
-export const CometChatAddMembers = ({ group, onBack }: IAddMembersProps) => {
- const [selectedUsers, setSelectedUsers] = useState([]);
- const [isLoading, setIsLoading] = useState(false);
-
- const addMembersToGroup = async () => {
- if (selectedUsers.length === 0) return;
- setIsLoading(true);
- try {
- const uids = selectedUsers.map(user => user.getUid());
- await CometChat.addMembersToGroup(uids, group.getGuid(), group.getType() as CometChat.GroupType);
- CometChatGroupEvents.ccGroupMemberAdded.next({
- addedBy: CometChatUIKitLoginListener.getLoggedInUser()!,
- addedMembers: selectedUsers,
- addedIn: group
- });
- onBack();
- } catch (error) {
- console.error("Failed to add members:", error);
- } finally {
- setIsLoading(false);
- }
- };
-};
-```
-
----
-
-### 5. Ban Members
-
-Fetch the list of banned members using `BannedMembersRequestBuilder`. This component displays banned users and provides unban functionality for group admins.
-
-_File: [CometChatBannedMembers.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatBannedMembers/CometChatBannedMembers.tsx)_
-
-```tsx lines
-export const CometChatBannedMembers = ({ group }: bannedMembersProp) => {
- const [bannedMembers, setBannedMembers] = useState([]);
- const [state, setState] = useState(States.loading);
-
- useEffect(() => {
- const bannedMembersRequest = new CometChat.BannedMembersRequestBuilder(group.getGuid())
- .setLimit(30)
- .build();
-
- bannedMembersRequest.fetchNext().then(
- bannedMembers => {
- setBannedMembers(bannedMembers);
- setState(States.loaded);
- },
- error => {
- console.log("Banned members fetch failed:", error);
- setState(States.error);
- }
- );
- }, [group]);
-};
-```
-
-
----
-
-### 6. Change Member Scope
-
-Promote or demote a member by calling `CometChat.updateGroupMemberScope()`. Pass the member's UID, the new scope (`admin`, `moderator`, or `participant`), and the group GUID. Emit `ccGroupMemberScopeChanged` so the UI reflects the role change.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const changeMemberScope = async (member: CometChat.GroupMember, newScope: string) => {
- try {
- await CometChat.updateGroupMemberScope(member.getUid(), newScope, group.getGuid());
- const updatedMember = { ...member, scope: newScope };
- CometChatGroupEvents.ccGroupMemberScopeChanged.next({
- changedBy: CometChatUIKitLoginListener.getLoggedInUser()!,
- changedUser: updatedMember,
- changedIn: group,
- newScope: newScope,
- oldScope: member.getScope()
- });
- } catch (error) {
- console.error("Failed to update member scope:", error);
- }
-};
-```
-
----
-
-### 7. Transfer Ownership
-
-Let the current owner select a member and transfer ownership via `CometChat.transferGroupOwnership()`. The group object is cloned and updated locally, then `ccOwnershipChanged` is emitted to sync the UI.
-
-_File: [CometChatTransferOwnership.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatTransferOwnership/CometChatTransferOwnership.tsx)_
-
-```tsx lines
-export const CometChatTransferOwnership = ({ group, onClose }: ITransferOwnershipProps) => {
- const [selectedMember, setSelectedMember] = useState(null);
- const [isLoading, setIsLoading] = useState(false);
- const [isError, setIsError] = useState(false);
-
- const transferOwnership = async () => {
- if (!selectedMember) return;
- setIsLoading(true);
- setIsError(false);
- try {
- await CometChat.transferGroupOwnership(group.getGuid(), selectedMember.getUid());
- const groupClone = CometChatUIKitUtility.clone(group);
- groupClone.setOwner(selectedMember.getUid());
- CometChatGroupEvents.ccOwnershipChanged.next({
- group: groupClone,
- newOwner: CometChatUIKitUtility.clone(selectedMember)
- });
- onClose();
- } catch (error) {
- setIsError(true);
- console.error("Ownership transfer failed:", error);
- } finally {
- setIsLoading(false);
- }
- };
-};
-```
-
----
-
-## Feature Matrix
-
-| Feature | Component / Method | File |
-|:---|:---|:---|
-| Create group | `CometChatCreateGroup` | [CometChatCreateGroup.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatCreateGroup/CometChatCreateGroup.tsx) |
-| Join group | `CometChatJoinGroup` | [CometChatJoinGroup.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatJoinGroup/CometChatJoinGroup.tsx) |
-| View members | `CometChatGroupMembers` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Add members | `CometChatAddMembers` | [CometChatAddMembers.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatAddMembers/CometChatAddMembers.tsx) |
-| Ban members | `CometChatBannedMembers` | [CometChatBannedMembers.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatBannedMembers/CometChatBannedMembers.tsx) |
-| Change scope | `updateGroupMemberScope()` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Transfer ownership | `CometChatTransferOwnership` | [CometChatTransferOwnership.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatTransferOwnership/CometChatTransferOwnership.tsx) |
-| Group events | `CometChatGroupEvents` | Multiple files |
-
----
-
-## Next Steps
-
-
-
- Display and manage group lists.
-
-
- Display and manage group member lists.
-
-
- Browse all feature and formatter guides.
-
-
- Full working sample application on GitHub.
-
-
\ No newline at end of file
diff --git a/ui-kit/react/guide-message-privately.mdx b/ui-kit/react/guide-message-privately.mdx
index 8095db11e..2c3edee72 100644
--- a/ui-kit/react/guide-message-privately.mdx
+++ b/ui-kit/react/guide-message-privately.mdx
@@ -1,189 +1,266 @@
---
title: "Message Privately"
sidebarTitle: "Message Privately"
-description: "Start private one-to-one chats from CometChat React UI Kit group conversations with message options, user lookup, and navigation."
+description: "Let users send a private one-on-one message to another user directly from within a group chat conversation."
---
-
+## Goal
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Key components | `CometChatMessages`, `CometChatGroupMembers`, `CometChatMessageComposer`, `CometChatMessageList`, `CometChatMessageHeader` |
-| Init | `CometChatUIKit.init(UIKitSettings)` then `CometChatUIKit.login("UID")` |
-| Purpose | Launch a direct 1:1 chat from a group member profile |
-| Sample app | [GitHub](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) |
-| Related | [All Guides](/ui-kit/react/guide-overview) |
+By the end of this guide you will have a group chat interface where users can select a group member and open a private one-on-one conversation with them — without leaving the current screen. This is useful for side conversations, follow-ups, or sensitive messages that shouldn't be shared with the entire group.
-
+## Prerequisites
-Message Privately lets users start a direct 1:1 conversation with a group member without leaving the group context. The user can return to the group after the private chat.
+- Completed the [Integration Guide](/ui-kit/react/integration-react) guide
+- A running `CometChatProvider` setup with valid credentials
+- An existing group chat screen using `CometChatMessageList` and `CometChatMessageComposer`
-Before starting, complete the [Getting Started](/ui-kit/react/react-js-integration) guide for your framework.
+## Components Used
----
+| Component / API | Purpose |
+|:----------------|:--------|
+| `CometChatMessageList` | Displays group messages (publishes `ui:open-chat` internally via "Message Privately" option) |
+| `CometChatMessageComposer` | Text input for the private conversation |
+| `CometChatMessageHeader` | Displays user/group info |
+| `useCometChatEvents` | Subscribe to `ui:open-chat` event |
+| `ui:open-chat` | UI event published when user clicks "Message Privately" |
-## Components
+## Step 1: Set up the main layout with provider
-| Component / Class | Role |
-|:---|:---|
-| `CometChatGroupMembers` | Displays group members with click handlers for private messaging |
-| `CometChatMessageComposer` | Input component for composing private messages |
-| `CometChatMessageList` | Displays private conversation messages |
-| `CometChatMessageHeader` | Header showing private chat information |
+Start with a layout that includes a conversations sidebar and a main chat area wrapped in `CometChatProvider`.
----
+```tsx App.tsx
+import { useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatProvider,
+ CometChatConversations,
+ CometChatMessageList,
+ CometChatMessageComposer,
+ CometChatMessageHeader,
+} from "@cometchat/chat-uikit-react";
-## Integration Steps
+function App() {
+ return (
+
+
+
+ );
+}
-### 1. Group Member Click Handler
+export default App;
+```
-When a group member is clicked, cast them to a `User` object and initiate a private chat. The current group is saved so the user can return to it later. `CometChat.getConversation()` fetches or creates the 1:1 conversation.
+## Step 2: Track group and private chat state
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
+Maintain state for the active group conversation and a separate state for the private user when a user initiates a private message.
-```tsx lines
-const handleGroupMemberClick = (groupMember: CometChat.GroupMember) => {
- const user = groupMember as CometChat.User;
- startPrivateChatFromGroup(user, currentGroup);
-}
+```tsx ChatWithPrivateMessaging.tsx
+import { useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+
+function ChatWithPrivateMessaging() {
+ const [user, setUser] = useState(null);
+ const [group, setGroup] = useState(null);
+ const [privateUser, setPrivateUser] = useState(null);
-const startPrivateChatFromGroup = (user: CometChat.User, group: CometChat.Group) => {
- setAppState({ type: "updatePreviousGroup", payload: group });
-
- CometChat.getConversation(user.getUid(), CometChatUIKitConstants.MessageReceiverType.user)
- .then((conversation) => {
- setSelectedItem(conversation);
- setAppState({ type: "updateSideComponent", payload: { visible: false, type: "" } });
- setShowPrivateChat(true);
- })
- .catch((error) => {
- console.error("Failed to start private chat:", error);
- });
+ // ... continued in next steps
}
```
----
+## Step 3: Handle conversation selection
-### 2. Group Members with Private Messaging Option
-
-Add a "Message Privately" option to the group members list. The `options` prop adds a context-menu action that triggers the private chat flow when clicked.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const GroupMembersWithPrivateMessaging = ({ group }: { group: CometChat.Group }) => {
- return (
- {
- handleGroupMemberClick(member);
- }
- }
- ]}
- selectionMode={SelectionMode.none}
- />
- );
+Connect `CometChatConversations` to switch between user and group chats. When switching conversations, close any open private message panel.
+
+```tsx
+function handleConversationClick(conversation: CometChat.Conversation) {
+ setPrivateUser(null); // close private panel on conversation switch
+
+ const entity = conversation.getConversationWith();
+ if (entity instanceof CometChat.User) {
+ setUser(entity);
+ setGroup(null);
+ } else if (entity instanceof CometChat.Group) {
+ setGroup(entity);
+ setUser(null);
+ }
}
```
----
+## Step 4: Initiate a private message from a group member
-### 3. Private Chat Interface
-
-Render a full chat view (header, message list, composer) for the 1:1 conversation. The header includes a back button that returns the user to the original group, and a subtitle showing which group the private chat was initiated from.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const PrivateChatFromGroupView = ({ user, previousGroup }: {
- user: CometChat.User,
- previousGroup: CometChat.Group
-}) => {
- const returnToGroup = () => {
- setShowPrivateChat(false);
- CometChat.getConversation(previousGroup.getGuid(), CometChatUIKitConstants.MessageReceiverType.group)
- .then((conversation) => {
- setSelectedItem(conversation);
- });
- };
-
- return (
-
-
- {}} />
-
-
- );
+Use the message header or a custom action to let users pick a group member for private messaging. You can fetch the user from a member click event or from the message sender's info.
+
+```tsx
+async function handleMessagePrivately(uid: string) {
+ try {
+ const targetUser = await CometChat.getUser(uid);
+ setPrivateUser(targetUser);
+ } catch (error) {
+ console.error("Failed to fetch user for private messaging:", error);
+ }
}
```
----
+## Step 5: Listen for the `ui:open-chat` event
+
+Use `useCometChatEvents` to subscribe to the `ui:open-chat` event, which is published internally when a user clicks "Message Privately" from the context menu. When the event fires, extract the user and open the private panel.
-### 4. State Management
+```tsx
+import { useCometChatEvents } from "@cometchat/chat-uikit-react";
+import type { CometChatEvent } from "@cometchat/chat-uikit-react";
-Add reducer cases to track the group the user came from, whether the private chat is visible, and which user is being messaged. This lets the app restore the group context when the user navigates back.
+useCometChatEvents(
+ (event: CometChatEvent) => {
+ if (event.type === "ui:open-chat" && event.user) {
+ setPrivateUser(event.user);
+ }
+ },
+ [group?.getGuid()]
+);
+```
-_File: [appReducer.ts](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/context/appReducer.ts)_
+## Step 6: Render the private message panel
-```tsx lines
-interface AppState {
- previousGroup?: CometChat.Group;
- showPrivateChat?: boolean;
- privateChatUser?: CometChat.User;
-}
+When `privateUser` is set, show a side panel with a private one-on-one chat. This panel includes a header, message list, and composer scoped to the private user.
-case "updatePreviousGroup": {
- return { ...state, ["previousGroup"]: action.payload };
-}
-case "updateShowPrivateChat": {
- return { ...state, ["showPrivateChat"]: action.payload };
-}
-case "updatePrivateChatUser": {
- return { ...state, ["privateChatUser"]: action.payload };
-}
-```
+```tsx
+{privateUser && (
+
+
+
+ Private: {privateUser.getName()}
+
+
+
----
+
+
+
-## Feature Matrix
+
+
+)}
+```
-| Feature | Component / Method | File |
-|:---|:---|:---|
-| Group member selection | `CometChatGroupMembers` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Private chat initiation | `startPrivateChatFromGroup()` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Private chat interface | `PrivateChatFromGroupView` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Context preservation | `updatePreviousGroup` | [appReducer.ts](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/context/appReducer.ts) |
-| Return to group | `returnToGroup()` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Member options | `options` in CometChatGroupMembers | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| State management | `updateShowPrivateChat` | [appReducer.ts](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/context/appReducer.ts) |
+## Step 7: Handle edge cases
+
+Consider these scenarios when implementing private messaging from a group:
+
+| Scenario | Behavior |
+|:---------|:---------|
+| User messages themselves | Disable the private message option for the logged-in user's own messages |
+| User is blocked | Check `getBlockedByMe()` before opening the private panel and show a prompt |
+| Private panel already open | Replace the current private user with the newly selected one |
+| Group conversation changes | Close the private panel when switching to a different conversation |
+
+## Complete Example
+
+```tsx App.tsx
+import { useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatProvider,
+ CometChatConversations,
+ CometChatMessageList,
+ CometChatMessageComposer,
+ CometChatMessageHeader,
+ useCometChatEvents,
+} from "@cometchat/chat-uikit-react";
+import type { CometChatEvent } from "@cometchat/chat-uikit-react";
+
+function ChatWithPrivateMessaging() {
+ const [user, setUser] = useState(null);
+ const [group, setGroup] = useState(null);
+ const [privateUser, setPrivateUser] = useState(null);
+
+ function handleConversationClick(conversation: CometChat.Conversation) {
+ setPrivateUser(null);
+ const entity = conversation.getConversationWith();
+ if (entity instanceof CometChat.User) {
+ setUser(entity);
+ setGroup(null);
+ } else if (entity instanceof CometChat.Group) {
+ setGroup(entity);
+ setUser(null);
+ }
+ }
+
+ async function handleMessagePrivately(uid: string) {
+ try {
+ const targetUser = await CometChat.getUser(uid);
+ setPrivateUser(targetUser);
+ } catch (error) {
+ console.error("Failed to fetch user for private messaging:", error);
+ }
+ }
+
+ useCometChatEvents(
+ (event: CometChatEvent) => {
+ if (event.type === "ui:open-chat" && event.user) {
+ setPrivateUser(event.user);
+ }
+ },
+ [group?.getGuid()]
+ );
+
+ return (
+
+ );
+}
----
+function App() {
+ return (
+
+
+
+ );
+}
+
+export default App;
+```
## Next Steps
-
-
- Display and manage group member lists.
-
-
- Render real-time message threads.
-
-
- Browse all feature and formatter guides.
-
-
- Full working sample application on GitHub.
-
-
+- [Message Composer](/ui-kit/react/components/message-composer) — customize the composer for private chats
+- [Conversations](/ui-kit/react/components/conversations) — manage the conversations list
+- [Users](/ui-kit/react/components/cometchat-users) — browse and select users directly
+- [CometChatProvider](/ui-kit/react/cometchat-provider) — learn about provider configuration
diff --git a/ui-kit/react/v7/guide-new-chat-creation.mdx b/ui-kit/react/guide-new-chat-creation.mdx
similarity index 93%
rename from ui-kit/react/v7/guide-new-chat-creation.mdx
rename to ui-kit/react/guide-new-chat-creation.mdx
index 2e1975d30..2572cbc7f 100644
--- a/ui-kit/react/v7/guide-new-chat-creation.mdx
+++ b/ui-kit/react/guide-new-chat-creation.mdx
@@ -10,9 +10,9 @@ By the end of this guide you will have a chat interface where users can initiate
## Prerequisites
-- Completed the [Integration Guide](/ui-kit/react/v7/integration-react) guide
+- Completed the [Integration Guide](/ui-kit/react/integration-react) guide
- A running `CometChatProvider` setup with valid credentials
-- Familiarity with [CometChatUsers](/ui-kit/react/v7/components/users) and [CometChatGroups](/ui-kit/react/v7/components/groups) components
+- Familiarity with [CometChatUsers](/ui-kit/react/components/users) and [CometChatGroups](/ui-kit/react/components/groups) components
## Components Used
@@ -34,16 +34,11 @@ Wrap your application in `CometChatProvider` and create a layout that will hold
import { useState } from "react";
import { CometChat } from "@cometchat/chat-sdk-javascript";
import { CometChatProvider } from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/styles";
import { NewChatApp } from "./NewChatApp";
function App() {
return (
-
+
);
@@ -266,7 +261,6 @@ import {
CometChatMessageComposer,
CometChatMessageHeader,
} from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/styles";
type ChatTarget =
| { type: "user"; entity: CometChat.User }
@@ -408,11 +402,7 @@ function NewChatApp() {
function App() {
return (
-
+
);
@@ -423,7 +413,7 @@ export default App;
## Next Steps
-- [CometChatUsers](/ui-kit/react/v7/components/users) — customize the user list appearance and filtering
-- [CometChatGroups](/ui-kit/react/v7/components/groups) — browse and manage groups
-- [Conversations](/ui-kit/react/v7/components/conversations) — display existing conversations
-- [Group Chat Setup](/ui-kit/react/v7/guide-group-chat-setup) — create and configure group conversations
+- [CometChatUsers](/ui-kit/react/components/users) — customize the user list appearance and filtering
+- [CometChatGroups](/ui-kit/react/components/groups) — browse and manage groups
+- [Conversations](/ui-kit/react/components/conversations) — display existing conversations
+- [Group Chat Setup](/ui-kit/react/guide-group-chat-setup) — create and configure group conversations
diff --git a/ui-kit/react/guide-new-chat.mdx b/ui-kit/react/guide-new-chat.mdx
deleted file mode 100644
index 40beee2ac..000000000
--- a/ui-kit/react/guide-new-chat.mdx
+++ /dev/null
@@ -1,206 +0,0 @@
----
-title: "New Chat"
-sidebarTitle: "New Chat"
-description: "Build a unified new chat entry point for starting 1:1 or group conversations in CometChat React UI Kit."
----
-
-
-
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Key components | `CometChatUsers`, `CometChatGroups`, `CometChatJoinGroup`, `CometChatSelector` |
-| Init | `CometChatUIKit.init(UIKitSettings)` then `CometChatUIKit.login("UID")` |
-| Purpose | Unified new chat entry point for starting 1:1 or group conversations |
-| Sample app | [GitHub](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) |
-| Related | [All Guides](/ui-kit/react/guide-overview) |
-
-
-
-The New Chat feature lets users start conversations with other users or join group conversations from a single interface.
-
-Before starting, complete the [Getting Started](/ui-kit/react/react-js-integration) guide for your framework.
-
----
-
-## Components
-
-| Component / Class | Role |
-|:---|:---|
-| `CometChatNewChatView` | Main container for new chat creation interface |
-| `CometChatUsers` | Displays list of available users for chat creation |
-| `CometChatGroups` | Shows available groups for joining |
-| `CometChatJoinGroup` | Handles protected group joining process |
-| `CometChatSelector` | Navigation component with new chat button |
-
----
-
-## Integration Steps
-
-### 1. New Chat State Management
-
-Track whether the new chat view is visible and which user/group was selected. When the "New Chat" button is clicked, show the view and hide any open side panels.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const [showNewChat, setShowNewChat] = useState(false);
-const [newChat, setNewChat] = useState<{
- user?: CometChat.User,
- group?: CometChat.Group
-} | undefined>();
-
-const onNewChatClicked = () => {
- setShowNewChat(true);
- setAppState({ type: "updateSideComponent", payload: { type: "", visible: false } });
-}
-```
-
----
-
-### 2. Conditional Rendering
-
-Switch between the new chat view, the messages view, or an empty state depending on the current app state. `useCallback` prevents unnecessary re-renders.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const InformationComponent = useCallback(() => {
- return (
- <>
- {showNewChat ?
- :
- (selectedItem || newChat?.user || newChat?.group) ? ()
- :
- ()
- }
- >
- )
-}, [activeTab, showNewChat, selectedItem, newChat, appState.goToMessageId]);
-```
-
----
-
-### 3. New Chat View
-
-The main new chat interface with a header, back button, and tabbed navigation between Users and Groups. Selecting a tab switches the list below.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const CometChatNewChatView: React.FC = () => {
- const [selectedTab, setSelectedTab] = useState('user');
- const [group, setGroup] = useState();
- const loggedInUser = CometChatUIKitLoginListener.getLoggedInUser();
-
- const handleTabClick = (tab: string) => {
- setSelectedTab(tab);
- };
-
- return (
-
- );
-};
-```
-
----
-
-### 4. User Selection and Chat Creation
-
-The tab content renders either `CometChatUsers` or `CometChatGroups`. Clicking a user creates a 1:1 chat and closes the new chat view. Clicking a group triggers the join flow.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const TabContent: React.FC = ({ selectedTab }) => {
- return selectedTab === 'user' ? {
- setNewChat({ user, group: undefined });
- setAppState({ type: "updateSideComponent", payload: { visible: false, type: "" } });
- setShowNewChat(false);
- setAppState({ type: "updateSelectedItemUser", payload: user });
- setAppState({ type: "updateSelectedItemGroup", payload: undefined });
- }}
- />
- : {
- setAppState({ type: "updateSelectedItemUser", payload: undefined });
- setAppState({ type: "updateSelectedItemGroup", payload: e });
- joinGroup(e)
- }} />;
-};
-```
-
----
-
-### 5. Group Joining Logic
-
-Handle the join flow based on group type. Public groups are joined directly via `CometChat.joinGroup()`. Password-protected groups show a password prompt first.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const joinGroup = (e) => {
- if (!e.getHasJoined()) {
- if (e.getType() === CometChatUIKitConstants.GroupTypes.public) {
- CometChat.joinGroup(...)
- .then((response) => { setNewChat({ group: response }); })
- .catch((error) => { console.log(error); });
- } else {
- setGroup(e);
- showJoinGroupRef.current = true;
- }
- }
-}
-```
-
----
-
-## Feature Matrix
-
-| Feature | Component / Method | File |
-|:---|:---|:---|
-| Open new chat view | `onNewChatClicked()` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| New chat interface | `CometChatNewChatView` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| User selection | `CometChatUsers` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Group selection | `CometChatGroups` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Group joining | `joinGroup()` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| State management | `showNewChat` state | [appReducer.ts](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/context/appReducer.ts) |
-| Chat creation | `setNewChat()` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Navigation handling | `setShowNewChat(false)` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-
----
-
-## Next Steps
-
-
-
- Display and manage conversation lists.
-
-
- Display and manage group lists.
-
-
- Browse all feature and formatter guides.
-
-
- Full working sample application on GitHub.
-
-
diff --git a/ui-kit/react/guide-overview.mdx b/ui-kit/react/guide-overview.mdx
deleted file mode 100644
index 765f2e2f0..000000000
--- a/ui-kit/react/guide-overview.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
----
-title: "Overview"
-sidebarTitle: "Overview"
-description: "Browse React UI Kit feature guides for blocking users, call details, group chat, private messages, search, and threaded conversations."
----
-
-
-
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Purpose | Index of task-oriented feature guides for the React UI Kit |
-| Sample app | [GitHub](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) |
-| Components | [Components Overview](/ui-kit/react/components-overview) |
-| Guides | [Block/Unblock](/ui-kit/react/guide-block-unblock-user) · [Call Log Details](/ui-kit/react/guide-call-log-details) · [Group Chat](/ui-kit/react/guide-group-chat) · [Message Privately](/ui-kit/react/guide-message-privately) · [New Chat](/ui-kit/react/guide-new-chat) · [Search Messages](/ui-kit/react/guide-search-messages) · [Threaded Messages](/ui-kit/react/guide-threaded-messages) |
-
-
-
-> This page indexes focused, task‑oriented feature guides for the React UI Kit. Each guide shows how to implement a specific capability end‑to‑end using UI components.
-
-## When to Use These Guides
-
-Use these guides after completing the base [Getting Started](/ui-kit/react/react-js-integration) (or framework variant: [Next.js](/ui-kit/react/next-js-integration), [React Router](/ui-kit/react/react-router-integration)). They help you layer additional UX without rewriting core chat flows.
-
-## Guide Directory
-
-| Guide | Description |
-|:------|:------------|
-| [Block / Unblock User](/ui-kit/react/guide-block-unblock-user) | Let users block or unblock others in 1:1 chats; hides composer and shows an unblock prompt while preventing message exchange. |
-| [Call Log Details](/ui-kit/react/guide-call-log-details) | Detailed call insights screen: metadata, participants, join/leave history, and recordings. |
-| [Group Management](/ui-kit/react/guide-group-chat) | Create/join groups, view members, add / ban users, change roles/scopes, transfer ownership. |
-| [Message Privately](/ui-kit/react/guide-message-privately) | Launch a direct 1:1 chat from a user profile or list; optionally send a first message to surface conversation. |
-| [New Chat](/ui-kit/react/guide-new-chat) | Unified entry for starting new 1:1 or group chats with user & group discovery. |
-| [Threaded Messages](/ui-kit/react/guide-threaded-messages) | Threaded replies: open parent context, list replies, compose within focused thread. |
-| [Search Messages](/ui-kit/react/guide-search-messages) | Add full‑text message search across conversations with result routing into context. |
-| [Custom Text Formatter](/ui-kit/react/custom-text-formatter-guide) | Extend the base formatter to implement custom inline patterns (hashtags, keywords) with regex + callbacks. |
-| [Mentions Formatter](/ui-kit/react/mentions-formatter-guide) | Add @mentions with styled tokens, suggestion list, and click handling for users & members. |
-| [URL Formatter](/ui-kit/react/url-formatter-guide) | Detect and style plain URLs; render them as clickable links with optional tracking logic. |
-| [Shortcut Formatter](/ui-kit/react/shortcut-formatter-guide) | Provide !shortcut style expansions invoking extension APIs or dialogs before inserting content. |
-
-Need another guide? Open a request via our [Support Portal](https://help.cometchat.com/hc/en-us/requests/new).
-
----
-
-## Next Steps
-
-
-
- Set up the React UI Kit
-
-
- Explore all UI components
-
-
- Customize themes and styling
-
-
- Handle UI Kit events
-
-
diff --git a/ui-kit/react/guide-search-messages.mdx b/ui-kit/react/guide-search-messages.mdx
index e510ead5c..b917e2ce8 100644
--- a/ui-kit/react/guide-search-messages.mdx
+++ b/ui-kit/react/guide-search-messages.mdx
@@ -1,132 +1,182 @@
---
title: "Search Messages"
sidebarTitle: "Search Messages"
-description: "Add CometChat React UI Kit message search with query input, scoped results, message selection, and navigation to matching chats."
+description: "Add message search to your chat so users can find specific messages within a conversation using the built-in CometChatSearch component."
---
-
+## Goal
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Key components | `CometChatSearchMessages`, `CometChatMessageList`, `CometChatMessageComposer`, `CometChatMessageHeader` |
-| Init | `CometChatUIKit.init(UIKitSettings)` then `CometChatUIKit.login("UID")` |
-| Purpose | Full-text message search across conversations with result routing and navigation |
-| Sample app | [GitHub](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) |
-| Related | [All Guides](/ui-kit/react/guide-overview) |
+By the end of this guide you will have a chat interface with a search panel that lets users find messages in a conversation by keyword and scroll to a selected result — using the built-in [`CometChatSearch`](/ui-kit/react/components/search) component instead of building your own search UI.
-
+`CometChatSearch` already handles the input, debouncing, SDK queries, result rendering, pagination, loading/empty/error states, and keyword highlighting — so you only wire it to your message list.
-Search Messages lets users locate specific messages across conversations and groups using keyword search, then navigate directly to the result.
+## Prerequisites
-Before starting, complete the [Getting Started](/ui-kit/react/react-js-integration) guide for your framework.
+- Completed the [Integration Guide](/ui-kit/react/integration-react)
+- A running `CometChatProvider` setup with valid credentials
+- An existing chat screen using `CometChatMessageList` and `CometChatMessageHeader`
----
-
-## Components
-
-| Component / Class | Role |
-|:---|:---|
-| `CometChatSearchMessages` | Main container for searching messages |
-| `CometChatMessageList` | Displays filtered messages based on search results |
-| `CometChatMessageComposer` | Supports navigation after selecting a search result |
-| `CometChatMessageHeader` | Displays search context and navigation controls |
+## Components Used
----
+| Component | Purpose |
+|:----------|:--------|
+| `CometChatSearch` | Built-in search panel — input, message queries, result list, and states |
+| `CometChatMessageList` | Displays messages and supports `goToMessageId` for scrolling to a result |
+| `CometChatMessageHeader` | Header with a search trigger button |
+| `CometChatConversations` | Sidebar for switching conversations |
-## Integration Steps
+## Step 1: Set up the chat layout with search state
-### 1. Search State Management
+Start with a full chat layout — a conversations sidebar, message panel, and state to control the search panel visibility and the message to jump to.
-Track the current search keyword and the message ID to scroll to. When a new search is triggered, reset `goToMessageId` so the list doesn't jump to a stale result.
+_File: App.tsx_
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
+```tsx
+import { useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatProvider,
+ CometChatConversations,
+ CometChatMessageList,
+ CometChatMessageComposer,
+ CometChatMessageHeader,
+ CometChatSearch,
+ type CometChatSearchMessageClickEvent,
+} from "@cometchat/chat-uikit-react";
-```tsx lines
-const [searchKeyword, setSearchKeyword] = useState("");
-const [goToMessageId, setGoToMessageId] = useState(undefined);
+function ChatWithSearch() {
+ const [user, setUser] = useState(null);
+ const [group, setGroup] = useState(null);
+ const [showSearch, setShowSearch] = useState(false);
+ const [goToMessageId, setGoToMessageId] = useState(undefined);
-const onSearch = (keyword: string) => {
- setSearchKeyword(keyword);
+ function handleConversationClick(conversation: CometChat.Conversation) {
+ setShowSearch(false);
setGoToMessageId(undefined);
-};
+ const entity = conversation.getConversationWith();
+ if (entity instanceof CometChat.User) {
+ setUser(entity);
+ setGroup(null);
+ } else if (entity instanceof CometChat.Group) {
+ setGroup(entity);
+ setUser(null);
+ }
+ }
+
+ // Fired by CometChatSearch when a message result is clicked
+ function handleMessageClick(event: CometChatSearchMessageClickEvent) {
+ setGoToMessageId(event.message.getId());
+ }
+
+ return (
+
+
+ {/* Built-in search panel, scoped to the open conversation */}
+ {showSearch && (user || group) && (
+
+ setShowSearch(false)}
+ />
+
+ )}
+
+ );
+}
+
+function App() {
+ return (
+
+
+
+ );
+}
+
+export default App;
```
----
-
-### 2. Search Input
+## Step 2: Scope CometChatSearch to the conversation
-Render the search component and wire its `onSearch` callback to update the keyword state. The placeholder text is localized.
+`CometChatSearch` is a complete, self-contained search panel — there's no custom input or result list to build. A few props tailor it to in-conversation message search:
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
- onSearch(keyword)}
- placeholder={getLocalizedString("search_messages_placeholder")}
+```tsx
+ setShowSearch(false)}
/>
```
----
+| Prop | What it does |
+|:-----|:-------------|
+| `searchIn={["messages"]}` | Shows only message results (omit it to also search conversations) |
+| `uid` / `guid` | Scopes the search to a single user or group conversation. Pass whichever matches the open chat |
+| `onMessageClicked` | Fired when a result is tapped. The event payload is `{ message, searchKeyword }` |
+| `onBack` | Fired when the back button is clicked — use it to close the panel |
+
+The component handles the search input, debouncing, SDK queries, pagination, and the loading/empty/error states internally. For the full prop list and customization (filter chips, custom result item views, request builders), see the [Search component reference](/ui-kit/react/components/search).
-### 3. Search Result Integration
+## Step 3: Navigate to a selected search result
-Pass `searchKeyword` and `goToMessageId` to `CometChatMessageList`. The list filters messages matching the keyword and highlights them. When `goToMessageId` is set, the list scrolls to that message.
+When a result is clicked, `onMessageClicked` gives you the selected `message`. Pass its ID to `CometChatMessageList` via the `goToMessageId` prop — the list scrolls to the matching message and highlights it.
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
+```tsx
+function handleMessageClick(event: CometChatSearchMessageClickEvent) {
+ setGoToMessageId(event.message.getId());
+}
-```tsx lines
```
----
-
-### 4. Navigate to Search Result
-
-When a user taps a search result, set `goToMessageId` to that message's ID. The message list will scroll to and highlight the target message.
-
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
-
-```tsx lines
-const handleResultClick = (messageId: number) => {
- setGoToMessageId(messageId);
-};
-```
-
-Attach `handleResultClick` to your message search result selection logic.
-
----
-
-## Feature Matrix
-
-| Feature | Component / Method | File |
-|:---|:---|:---|
-| Search input | `CometChatSearchMessages` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Display results | `CometChatMessageList` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Keyword highlighting | `searchKeyword` prop | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| Navigate to result | `goToMessageId` | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-| State management | `onSearch` handler | [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx) |
-
----
+
+Reset `goToMessageId` to `undefined` when switching conversations (as in `handleConversationClick` above) so the list doesn't try to jump to a message ID from a previous chat.
+
## Next Steps
-
-
- The search component reference.
-
-
- Render real-time message threads.
-
-
- Browse all feature and formatter guides.
-
-
- Full working sample application on GitHub.
-
-
+- [Search](/ui-kit/react/components/search) — full `CometChatSearch` reference: filters, scopes, custom result views, and request builders
+- [Message List](/ui-kit/react/components/message-list) — configure message rendering and scroll behavior
+- [Message Header](/ui-kit/react/components/message-header) — customize header actions and auxiliary views
+- [Threaded Messages](/ui-kit/react/guide-threaded-messages) — add threaded replies to your chat
diff --git a/ui-kit/react/guide-threaded-messages.mdx b/ui-kit/react/guide-threaded-messages.mdx
index da08eeb2e..ced528be6 100644
--- a/ui-kit/react/guide-threaded-messages.mdx
+++ b/ui-kit/react/guide-threaded-messages.mdx
@@ -1,189 +1,214 @@
---
title: "Threaded Messages"
sidebarTitle: "Threaded Messages"
-description: "Implement threaded message replies with parent context, reply list, and focused thread composer in CometChat React UI Kit."
+description: "Add threaded message replies to your chat so users can create focused sub-conversations on any message."
---
-
+## Goal
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Key components | `CometChatThreadedMessages`, `CometChatThreadHeader`, `CometChatMessageList`, `CometChatMessageComposer` |
-| Init | `CometChatUIKit.init(UIKitSettings)` then `CometChatUIKit.login("UID")` |
-| Entry point | `CometChatMessages.onThreadRepliesClick` opens thread view from group messages |
-| Sample app | [GitHub](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) |
-| Related | [All Guides](/ui-kit/react/guide-overview) |
+By the end of this guide you will have a chat interface where users can open a thread panel from any message, view the parent message with its reply count, browse threaded replies, and send new replies — all using v7 compound components and a state-based approach (no custom events needed).
-
+## Prerequisites
-Threaded messages let users create sub-conversations by replying to specific messages in group chats. This reduces clutter and keeps discussions focused.
+- Completed the [Integration Guide](/ui-kit/react/integration-react) guide
+- A running `CometChatProvider` setup with valid credentials
+- An existing chat screen using `CometChatMessageList` and `CometChatMessageComposer`
-Before starting, complete the [Getting Started](/ui-kit/react/react-js-integration) guide for your framework.
+## Components Used
----
-
-## Components
-
-| Component / Class | Role |
-|:---|:---|
-| `CometChatThreadedMessages` | Main container for threaded messages |
-| `CometChatThreadHeader` | Displays parent message and controls |
-| `CometChatMessageList` | Shows messages filtered by `parentMessageId` |
-| `CometChatMessageComposer` | Input for composing threaded replies |
-| `CometChatMessages.onThreadRepliesClick` | Opens thread view from group messages |
+| Component | Purpose |
+|:----------|:--------|
+| `CometChatThreadHeader` | Displays the parent message and reply count at the top of the thread panel |
+| `CometChatMessageList` | Renders threaded replies when given a `parentMessageId` |
+| `CometChatMessageComposer` | Sends replies into the thread with `parentMessageId`, `layout="compact"`, and `enableRichTextEditor` |
----
-
-## Integration Steps
+## Step 1: Thread State Management
-### 1. Thread State Management
+Store the `threadedMessage` in state. When set, the thread panel renders. When cleared, it closes. This mirrors the pattern used in the sample app's `CometChatThreadPanel` component.
-Store the parent message that the user clicked "Reply in Thread" on. When set, update the app state to show the threaded messages side panel.
+_File: ChatWithThreads.tsx_
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
+```tsx
+import { useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
-```tsx lines
-const [threadedMessage, setThreadedMsg] = useState();
+function ChatWithThreads() {
+ const [user, setUser] = useState(null);
+ const [group, setGroup] = useState(null);
+ const [threadedMessage, setThreadedMessage] = useState(null);
-const updateThreadedMessage = (message: CometChat.BaseMessage) => {
- setThreadedMsg(message);
- setAppState({ type: "updateSideComponent", payload: { visible: true, type: "threadedMessage" } });
- setAppState({ type: "updateThreadedMessage", payload: message });
-};
+ // Thread opens when threadedMessage is set, closes when cleared
+}
```
----
+## Step 2: Wire the Thread Trigger
-### 2. Thread Trigger in Group Messages
+Use the `onThreadRepliesClick` callback on `CometChatMessageList` to capture when a user clicks "Reply in Thread." This sets the threaded message and opens the panel — no events required.
-Wire the `onThreadRepliesClick` callback on `CometChatMessages`. When a user clicks the thread reply icon on any message, this fires with the parent message object.
+_File: ChatWithThreads.tsx_
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
+```tsx
+import { CometChatMessageList } from "@cometchat/chat-uikit-react";
-```tsx lines
- updateThreadedMessage(message)}
+ setThreadedMessage(message)}
/>
```
----
+## Step 3: Build the Thread Panel
-### 3. Threaded Messages Component
+When `threadedMessage` is set, render a side panel composing `CometChatThreadHeader` + `CometChatMessageList` (with `parentMessageId`) + `CometChatMessageComposer` (with `parentMessageId`, `layout="compact"`, and `enableRichTextEditor`). The `onClose` callback clears the state to dismiss the panel.
-Render the thread panel with the parent message, reply list, and composer. `goToMessageId` and `searchKeyword` support in-thread search navigation.
+_File: ChatWithThreads.tsx_
-_File: [CometChatHome.tsx](https://github.com/cometchat/cometchat-uikit-react/blob/v6/sample-app/src/components/CometChatHome/CometChatHome.tsx)_
+```tsx
+import {
+ CometChatThreadHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
+} from "@cometchat/chat-uikit-react";
-```tsx lines
-
-```
-
----
-
-### 4. App State Management
-
-Add reducer cases to store the threaded message and control the side panel visibility. These are dispatched by `updateThreadedMessage` in step 1.
+{threadedMessage && (
+
+)}
```
----
-
-## Implementation Flow
+## Step 4: Handle Parent Deleted
-Fetch the parent message, load replies, send new replies, and handle live updates:
-
-```tsx lines
-const parentMessage = message;
-const group = selectedItem as CometChat.Group;
-```
+Use the `onParentDeleted` prop on `CometChatThreadHeader` to automatically close the thread panel when the parent message is deleted by another user or a moderation action.
-```tsx lines
-
-```
+_File: ChatWithThreads.tsx_
-```tsx lines
- setThreadedMessage(null)}
+ onParentDeleted={() => setThreadedMessage(null)}
/>
```
-When the composer is blocked (e.g. permissions), show a fallback:
-
-```tsx lines
-{showComposer ? (
-
-) : (
-
@@ -143,10 +155,10 @@ export default function CometChatApp() {
}
```
-`CometChatProvider` handles init, login, and all context setup automatically. For advanced use cases (custom login flows, individual providers), see the [CometChatProvider](/ui-kit/react/v7/cometchat-provider) guide.
+`CometChatProvider` supplies theme, locale, plugin registry, and event context to all child components. Init and login happen in `useEffect` and the provider only mounts after login succeeds. See the [CometChatProvider](/ui-kit/react/cometchat-provider) guide for all props.
-For production, use the `authToken` prop instead of `authKey` + `uid`. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.
+For production, use `CometChatUIKit.loginWithAuthToken(token)` instead of `login(uid)`. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.
---
@@ -224,19 +236,31 @@ Tabbed navigation — Chat, Call Logs, Users, Settings in separate tabs.
---
+## Build Your Own Chat Experience
+
+Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.
+
+- [Sample App](https://github.com/cometchat/cometchat-uikit-react/tree/v7/sample-app) — Working reference app to compare against
+- [Components](/ui-kit/react/components-overview) — All prebuilt UI elements with props and customization options
+- [Core Features](/ui-kit/react/core-features) — Messaging, real-time updates, and other capabilities
+- [Theming](/ui-kit/react/theming) — Colors, fonts, dark mode, and custom styling
+- [Build Your Own UI](/sdk/javascript/overview) — Skip the UI Kit entirely and build on the raw SDK
+
+---
+
## Next Steps
-
+
Browse all prebuilt UI components
-
+
Customize colors, fonts, and styles
-
+
Customize message rendering
-
+
Common issues and fixes
diff --git a/ui-kit/react/v7/integration-nextjs.mdx b/ui-kit/react/integration-nextjs.mdx
similarity index 68%
rename from ui-kit/react/v7/integration-nextjs.mdx
rename to ui-kit/react/integration-nextjs.mdx
index 5662ad03f..ccdb3a670 100644
--- a/ui-kit/react/v7/integration-nextjs.mdx
+++ b/ui-kit/react/integration-nextjs.mdx
@@ -1,7 +1,7 @@
---
title: "Next.js Integration"
sidebarTitle: "Integration"
-description: "Add CometChat to a Next.js (App Router) app in 4 steps: create project, install, wrap in CometChatProvider, run."
+description: "Add CometChat to a Next.js (App Router) app in 5 steps: create project, install, init + login, render, run."
---
@@ -10,12 +10,13 @@ description: "Add CometChat to a Next.js (App Router) app in 4 steps: create pro
| --- | --- |
| Package | `@cometchat/chat-uikit-react` v7.0.x |
| Peer deps | `react` >=18, `react-dom` >=18, `@cometchat/chat-sdk-javascript` ^4.1.9, `dompurify` ^3.3.1 |
-| Setup | Wrap app in `` |
-| Auth Key | Dev/testing only. Use `authToken` prop in production |
-| CSS | `import "@cometchat/chat-uikit-react/styles";` |
+| Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` |
+| Login | `CometChatUIKit.login("UID")` — must resolve before rendering components |
+| Order | `init()` → `login()` → render ``. Breaking this order = blank screen |
+| Auth Key | Dev/testing only. Use `loginWithAuthToken` in production |
| SSR | CometChat components must be loaded with `dynamic(() => import(...), { ssr: false })` |
-| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and set `callingEnabled` prop |
-| Other frameworks | [React.js](/ui-kit/react/v7/integration-react) · [React Router](/ui-kit/react/v7/integration-react-router) · [Astro](/ui-kit/react/v7/integration-astro) |
+| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` |
+| Other frameworks | [React.js](/ui-kit/react/integration-react) · [React Router](/ui-kit/react/integration-react-router) · [Astro](/ui-kit/react/integration-astro) |
@@ -80,7 +81,7 @@ npm install @cometchat/calls-sdk-javascript
## Step 3 — Create the CometChat Client Component
-CometChat uses browser APIs and cannot run in Server Components. Create a `'use client'` component that wraps your chat UI in `CometChatProvider`.
+CometChat uses browser APIs and cannot run in Server Components. Create a `'use client'` component that initializes the SDK, logs in, and renders your chat UI inside `CometChatProvider`.
For development, use one of the pre-created test UIDs:
@@ -89,21 +90,39 @@ For development, use one of the pre-created test UIDs:
```tsx title="app/CometChatClient.tsx"
'use client';
-import { useState } from "react";
+import { useEffect, useState } from "react";
import { CometChat } from "@cometchat/chat-sdk-javascript";
import {
+ CometChatUIKit,
+ UIKitSettingsBuilder,
CometChatProvider,
CometChatConversations,
CometChatMessageHeader,
CometChatMessageList,
CometChatMessageComposer,
} from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/styles";
export default function CometChatClient() {
+ const [ready, setReady] = useState(false);
const [chatUser, setChatUser] = useState();
const [chatGroup, setChatGroup] = useState();
+ useEffect(() => {
+ const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
+ .subscribePresenceForAllUsers()
+ .build();
+
+ CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ setReady(true);
+ });
+ }, []);
+
+ if (!ready) return
@@ -141,10 +155,10 @@ export default function CometChatClient() {
}
```
-`'use client'` is required because CometChat components use browser APIs. `CometChatProvider` handles init, login, and all context setup automatically. For advanced use cases (custom login flows, individual providers), see the [CometChatProvider](/ui-kit/react/v7/cometchat-provider) guide.
+`'use client'` is required because CometChat components use browser APIs. Init and login happen in a `useEffect`, and the provider only mounts after login succeeds. See the [CometChatProvider](/ui-kit/react/cometchat-provider) guide for all provider props.
-For production, use the `authToken` prop instead of `authKey` + `uid`. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.
+For production, use `CometChatUIKit.loginWithAuthToken(token)` instead of `login(uid)`. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.
---
@@ -215,19 +229,31 @@ Tabbed navigation — Chat, Call Logs, Users, Settings in separate tabs.
---
+## Build Your Own Chat Experience
+
+Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.
+
+- [Sample App](https://github.com/cometchat/cometchat-uikit-react/tree/v7/sample-app) — Working reference app to compare against
+- [Components](/ui-kit/react/components-overview) — All prebuilt UI elements with props and customization options
+- [Core Features](/ui-kit/react/core-features) — Messaging, real-time updates, and other capabilities
+- [Theming](/ui-kit/react/theming) — Colors, fonts, dark mode, and custom styling
+- [Build Your Own UI](/sdk/javascript/overview) — Skip the UI Kit entirely and build on the raw SDK
+
+---
+
## Next Steps
-
+
Browse all prebuilt UI components
-
+
Customize colors, fonts, and styles
-
+
Customize message rendering
-
+
Common issues and fixes
diff --git a/ui-kit/react/v7/integration-react-router.mdx b/ui-kit/react/integration-react-router.mdx
similarity index 70%
rename from ui-kit/react/v7/integration-react-router.mdx
rename to ui-kit/react/integration-react-router.mdx
index b315077e4..3cc261677 100644
--- a/ui-kit/react/v7/integration-react-router.mdx
+++ b/ui-kit/react/integration-react-router.mdx
@@ -1,7 +1,7 @@
---
title: "React Router Integration"
sidebarTitle: "Integration"
-description: "Add CometChat to a React Router app in 5 steps: create project, install, init, login, render."
+description: "Add CometChat to a React Router app in 5 steps: create project, install, init + login, render, run."
---
@@ -12,12 +12,11 @@ description: "Add CometChat to a React Router app in 5 steps: create project, in
| Peer deps | `react` >=18, `react-dom` >=18, `@cometchat/chat-sdk-javascript` ^4.1.9, `dompurify` ^3.3.1 |
| Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` |
| Login | `CometChatUIKit.login("UID")` — must resolve before rendering components |
-| Order | `init()` → `login()` → render. Breaking this order = blank screen |
+| Order | `init()` → `login()` → render ``. Breaking this order = blank screen |
| Auth Key | Dev/testing only. Use Auth Token in production |
-| CSS | `import "@cometchat/chat-uikit-react/styles";` |
| SSR | N/A — client-side SPA by default |
-| Calling | Optional. Install `@cometchat/calls-sdk-javascript` to enable |
-| Other frameworks | [React.js](/ui-kit/react/v7/integration-react) · [Next.js](/ui-kit/react/v7/integration-nextjs) · [Astro](/ui-kit/react/v7/integration-astro) |
+| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` |
+| Other frameworks | [React.js](/ui-kit/react/integration-react) · [Next.js](/ui-kit/react/integration-nextjs) · [Astro](/ui-kit/react/integration-astro) |
@@ -80,9 +79,9 @@ npm install @cometchat/calls-sdk-javascript
---
-## Step 3 — Set Up Routes and Render
+## Step 3 — Initialize, Login, and Set Up Routes
-Create your route structure with a chat route. `CometChatProvider` handles init and login automatically.
+Call `CometChatUIKit.init()` and `CometChatUIKit.login()` before rendering. Then wrap your chat route in `CometChatProvider`.
For development, use one of the pre-created test UIDs:
@@ -91,14 +90,24 @@ For development, use one of the pre-created test UIDs:
```tsx title="src/main.tsx"
import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
+import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
import App from "./App";
-const root = ReactDOM.createRoot(document.getElementById("root")!);
-root.render(
-
-
-
-);
+const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
+ .subscribePresenceForAllUsers()
+ .build();
+
+CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ ReactDOM.createRoot(document.getElementById("root")!).render(
+
+
+
+ );
+});
```
```tsx title="src/App.tsx"
@@ -127,7 +136,6 @@ import {
CometChatMessageList,
CometChatMessageComposer,
} from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/styles";
export default function ChatPage() {
const [chatUser, setChatUser] = useState();
@@ -145,12 +153,7 @@ export default function ChatPage() {
};
return (
-
+
@@ -170,10 +173,10 @@ export default function ChatPage() {
}
```
-`CometChatProvider` handles init, login, and all context setup automatically. For advanced use cases (custom login flows, individual providers), see the [CometChatProvider](/ui-kit/react/v7/cometchat-provider) guide.
+Init and login complete before the app renders. `CometChatProvider` then supplies theme, locale, plugin registry, and event context. See the [CometChatProvider](/ui-kit/react/cometchat-provider) guide for all props.
-For production, use the `authToken` prop instead of `authKey` + `uid`. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.
+For production, use `CometChatUIKit.loginWithAuthToken(token)` instead of `login(uid)`. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.
---
@@ -224,19 +227,31 @@ Tabbed navigation — Chat, Call Logs, Users, Settings in separate tabs.
---
+## Build Your Own Chat Experience
+
+Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.
+
+- [Sample App](https://github.com/cometchat/cometchat-uikit-react/tree/v7/sample-app) — Working reference app to compare against
+- [Components](/ui-kit/react/components-overview) — All prebuilt UI elements with props and customization options
+- [Core Features](/ui-kit/react/core-features) — Messaging, real-time updates, and other capabilities
+- [Theming](/ui-kit/react/theming) — Colors, fonts, dark mode, and custom styling
+- [Build Your Own UI](/sdk/javascript/overview) — Skip the UI Kit entirely and build on the raw SDK
+
+---
+
## Next Steps
-
+
Browse all prebuilt UI components
-
+
Customize colors, fonts, and styles
-
+
Customize message rendering
-
+
Common issues and fixes
diff --git a/ui-kit/react/v7/integration-react.mdx b/ui-kit/react/integration-react.mdx
similarity index 60%
rename from ui-kit/react/v7/integration-react.mdx
rename to ui-kit/react/integration-react.mdx
index 6038b2245..be1b58400 100644
--- a/ui-kit/react/v7/integration-react.mdx
+++ b/ui-kit/react/integration-react.mdx
@@ -1,7 +1,7 @@
---
title: "React.js Integration"
sidebarTitle: "Integration"
-description: "Add CometChat to a React.js app in 4 steps: create project, install, wrap in CometChatProvider, run."
+description: "Add CometChat to a React.js app in 4 steps: create project, install, init + login, render."
---
@@ -10,11 +10,12 @@ description: "Add CometChat to a React.js app in 4 steps: create project, instal
| --- | --- |
| Package | `@cometchat/chat-uikit-react` v7.0.x |
| Peer deps | `react` >=18, `react-dom` >=18, `@cometchat/chat-sdk-javascript` ^4.1.9, `dompurify` ^3.3.1 |
-| Setup | Wrap app in `` |
-| Auth Key | Dev/testing only. Use `authToken` prop in production |
-| CSS | `import "@cometchat/chat-uikit-react/styles";` |
-| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and set `callingEnabled` prop |
-| Other frameworks | [Next.js](/ui-kit/react/v7/integration-nextjs) · [React Router](/ui-kit/react/v7/integration-react-router) · [Astro](/ui-kit/react/v7/integration-astro) |
+| Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` |
+| Login | `CometChatUIKit.login("UID")` — must resolve before rendering components |
+| Order | `init()` → `login()` → render ``. Breaking this order = blank screen |
+| Auth Key | Dev/testing only. Use Auth Token in production |
+| Calling | Optional. Install `@cometchat/calls-sdk-javascript` and call `.setCallingEnabled(true)` on `UIKitSettingsBuilder` |
+| Other frameworks | [Next.js](/ui-kit/react/integration-nextjs) · [React Router](/ui-kit/react/integration-react-router) · [Astro](/ui-kit/react/integration-astro) |
@@ -86,14 +87,32 @@ npm install @cometchat/calls-sdk-javascript
---
-## Step 3 — Render with CometChatProvider
+## Step 3 — Initialize, Login, and Render
-Wrap your app in `CometChatProvider` with your credentials. It handles SDK initialization, login, and all internal context setup automatically.
+Call `CometChatUIKit.init()` and `CometChatUIKit.login()` before rendering your app. Then wrap your components in `CometChatProvider`.
For development, use one of the pre-created test UIDs:
`cometchat-uid-1` · `cometchat-uid-2` · `cometchat-uid-3` · `cometchat-uid-4` · `cometchat-uid-5`
+```tsx title="src/main.tsx"
+import ReactDOM from "react-dom/client";
+import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
+import App from "./App";
+
+const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
+ .subscribePresenceForAllUsers()
+ .build();
+
+CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ ReactDOM.createRoot(document.getElementById("root")!).render();
+});
+```
+
```tsx title="src/App.tsx"
import { useState } from "react";
import { CometChat } from "@cometchat/chat-sdk-javascript";
@@ -104,7 +123,6 @@ import {
CometChatMessageList,
CometChatMessageComposer,
} from "@cometchat/chat-uikit-react";
-import "@cometchat/chat-uikit-react/styles";
function App() {
const [chatUser, setChatUser] = useState();
@@ -122,12 +140,7 @@ function App() {
};
return (
-
+
@@ -149,10 +162,14 @@ function App() {
export default App;
```
-`CometChatProvider` handles init, login, plugin registration, theming, locale, and real-time events — no manual setup needed. For advanced use cases (custom login flows, individual providers), see the [CometChatProvider](/ui-kit/react/v7/cometchat-provider) guide.
+`CometChatProvider` supplies theme, locale, plugin registry, and event context to all child components. Init and login must complete before the provider mounts. See the [CometChatProvider](/ui-kit/react/cometchat-provider) guide for all props.
+
+
+For production, use `CometChatUIKit.loginWithAuthToken(token)` instead of `login(uid)`. Generate auth tokens server-side via the [REST API](/rest-api/chat-apis). Never ship auth keys in client code.
+
-For production, use the `authToken` prop instead of `authKey` + `uid`. Generate auth tokens server-side via the CometChat REST API. Never ship auth keys in client code.
+By default, session data is stored in `localStorage`. To use `sessionStorage` instead, see [Setting Session Storage Mode](/ui-kit/react/methods#setting-session-storage-mode).
---
@@ -203,19 +220,49 @@ Tabbed navigation — Chat, Call Logs, Users, Settings in separate tabs.
---
+## Build Your Own Chat Experience
+
+Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.
+
+- [Sample App](https://github.com/cometchat/cometchat-uikit-react/tree/v7/sample-app) — Working reference app to compare against
+- [Components](/ui-kit/react/components-overview) — All prebuilt UI elements with props and customization options
+- [Core Features](/ui-kit/react/core-features) — Messaging, real-time updates, and other capabilities
+- [Theming](/ui-kit/react/theming) — Colors, fonts, dark mode, and custom styling
+- [Build Your Own UI](/sdk/javascript/overview) — Skip the UI Kit entirely and build on the raw SDK
+
+---
+
+## iFrame Embedding
+
+If your React app runs inside an `
+
+ );
+}
+```
-```css title="CometChatNoSSR.css" lines
+```css title="app/chat/chat.css"
.conversations-with-messages {
display: flex;
- height: 100%;
+ height: 100vh;
width: 100%;
}
.conversations-wrapper {
+ width: 360px;
height: 100%;
- width: 480px;
+ border-right: 1px solid #eee;
overflow: hidden;
display: flex;
flex-direction: column;
- height: inherit;
-}
-
-.conversations-wrapper > .cometchat {
- overflow: hidden;
}
.messages-wrapper {
- width: calc(100% - 480px);
+ flex: 1;
height: 100%;
display: flex;
flex-direction: column;
}
.empty-conversation {
- height: 100%;
- width: 100%;
+ flex: 1;
display: flex;
justify-content: center;
align-items: center;
- background: white;
+ background: var(--cometchat-background-color-03, #f5f5f5);
color: var(--cometchat-text-color-secondary, #727272);
font: var(--cometchat-font-body-regular, 400 14px Roboto);
}
-
-.cometchat .cometchat-message-composer {
- border-radius: 0px;
-}
```
-
-
-
----
-
-## Step 3 — Disable SSR in Your Page
-
-Dynamically import `CometChatNoSSR` with `ssr: false` so it only loads client-side.
-
-```tsx title="index.tsx" lines
-import dynamic from "next/dynamic";
-import "@cometchat/chat-uikit-react/css-variables.css";
+```tsx title="app/chat/page.tsx"
+import dynamic from 'next/dynamic';
-const CometChatComponent = dynamic(
- () => import("../CometChatNoSSR/CometChatNoSSR"),
- { ssr: false }
-);
+const CometChatClient = dynamic(() => import('./CometChatClient'), { ssr: false });
-export default function Home() {
- return ;
+export default function ChatPage() {
+ return ;
}
```
-CometChat depends on browser APIs (`window`, `WebSocket`, `document`). Setting `ssr: false` ensures the component only renders on the client, avoiding hydration errors.
+---
+
+## How It Works
+
+1. **`'use client'`** marks the component as a Client Component — required because CometChat uses browser APIs.
+2. **`dynamic(() => import(...), { ssr: false })`** prevents the component from rendering on the server, avoiding `window is not defined` errors.
+3. **CometChatProvider** wraps the entire tree — it supplies theme, locale, and event context to all CometChat components.
+4. **CometChatConversations** renders the sidebar list. When a user clicks a conversation, `onItemClick` fires with the `Conversation` object.
+5. **handleConversationClick** extracts the `User` or `Group` from the conversation and stores it in state.
+6. **Message components** (`MessageHeader`, `MessageList`, `MessageComposer`) receive either `user` or `group` as a prop — never both at the same time.
---
-## Step 4 — Run the Project
+## Run
-
-
-```bash lines
+```bash
npm run dev
```
-
-
-```bash lines
-pnpm dev
-```
-
-
-```bash lines
-yarn dev
-```
-
-
-You should see the conversation list on the left. Tap any conversation to load messages on the right.
+Open `http://localhost:3000/chat`. You should see the conversation list on the left. Click any conversation to load messages on the right.
---
## Next Steps
-
- Customize colors, fonts, and styles to match your brand
+
+ Single chat window without a sidebar
+
+
+ Tabbed navigation with Chats, Calls, Users
Browse all prebuilt UI components
- } href="/ui-kit/react/next-js-integration">
- Back to the main setup guide
-
-
- Chat features included out of the box
+
+ Customize colors, fonts, and styles
diff --git a/ui-kit/react/next-js-integration.mdx b/ui-kit/react/next-js-integration.mdx
deleted file mode 100644
index 71993f00e..000000000
--- a/ui-kit/react/next-js-integration.mdx
+++ /dev/null
@@ -1,368 +0,0 @@
----
-title: "Next.js Integration"
-sidebarTitle: "Integration"
-description: "Integrate CometChat React UI Kit with Next.js using client components, app credentials, package setup, initialization, and login."
----
-
-
-
-| Field | Value |
-| --- | --- |
-| Package | `@cometchat/chat-uikit-react` |
-| Peer deps | `react` >=18, `react-dom` >=18, `rxjs` ^7.8.1 |
-| Init | `CometChatUIKit.init(UIKitSettings)` — must resolve before `login()` |
-| Login | `CometChatUIKit.login("UID")` — must resolve before rendering components |
-| Order | `init()` → `login()` → render. Breaking this order = blank screen |
-| Auth Key | Dev/testing only. Use Auth Token in production |
-| SSR | CometChat requires browser APIs — use dynamic import with `ssr: false` |
-| CSS | `@import url("@cometchat/chat-uikit-react/css-variables.css");` in global CSS |
-| Calling | Optional. Install `@cometchat/calls-sdk-javascript` to enable |
-| Other frameworks | [React.js](/ui-kit/react/react-js-integration) · [React Router](/ui-kit/react/react-router-integration) · [Astro](/ui-kit/react/astro-integration) |
-| AI Skills | `npx @cometchat/skills add` — [GitHub](https://github.com/cometchat/cometchat-skills) |
-
-
-
-This guide walks you through adding CometChat to a Next.js app. By the end you'll have a working chat UI.
-
-
-
-
-
-
-CometChat UI Kit requires browser APIs (`window`, `WebSocket`, `document`). In Next.js, always load CometChat components client-side using dynamic imports with `ssr: false`.
-
-
----
-
-## Integrate with AI Coding Agents
-
-Skip the manual steps — use [CometChat Skills](https://github.com/cometchat/cometchat-skills) to integrate via your AI coding agent. Your agent has a short conversation with you to understand your project and chat requirements, then writes production-grade integration code tailored to the files you already have.
-
-```bash
-npx @cometchat/skills add
-```
-
-Use `--ide ` to target a specific IDE (e.g. `--ide cursor`), or `--ide all` for all supported IDEs.
-
-Then in your IDE:
-
-```
-/cometchat add chat to my app
-```
-
-The skill detects your Next.js version and router type (App Router vs Pages Router), env prefix, and existing auth system. It onboards you to CometChat directly in the terminal — signup, login, and app creation all via the CLI. It reads your routes, nav, and components before proposing a placement, shows the plan, and waits for your approval before writing code.
-
-After the first integration, re-run `/cometchat` to access the iteration menu: theme presets, 40+ features, component customization, floating widget, production auth, user management, and diagnostics.
-
-Works with Claude Code, Cursor, Codex, VS Code Copilot, Windsurf, Cline, Kiro, and [30+ more agents](https://github.com/cometchat/cometchat-skills).
-
----
-
-## Prerequisites
-
-You need three things from the [CometChat Dashboard](https://app.cometchat.com/):
-
-| Credential | Where to find it |
-| --- | --- |
-| App ID | Dashboard → Your App → Credentials |
-| Auth Key | Dashboard → Your App → Credentials |
-| Region | Dashboard → Your App → Credentials (e.g. `us`, `eu`, `in`) |
-
-You also need Node.js (v16+) and npm/yarn installed.
-
-
-Auth Key is for development only. In production, generate Auth Tokens server-side via the [REST API](/rest-api/chat-apis) and use [`loginWithAuthToken()`](/ui-kit/react/methods#login-using-auth-token). Never ship Auth Keys in client code.
-
-
----
-
-## Step 1 — Create a Next.js Project
-
-```bash lines
-npx create-next-app@latest my-app --typescript
-cd my-app
-```
-
----
-
-## Step 2 — Install the UI Kit
-
-
-
-```bash lines
-npm install @cometchat/chat-uikit-react
-```
-
-
-```bash lines
-yarn add @cometchat/chat-uikit-react
-```
-
-
-
-This installs the UI Kit and its dependency `@cometchat/chat-sdk-javascript` automatically.
-
-If you want voice/video calling, also install:
-
-```bash lines
-npm install @cometchat/calls-sdk-javascript
-```
-
----
-
-## Step 3 — Initialize CometChat
-
-
-
-
-```ts lines highlight={7-9}
-import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
-
-/**
- * CometChat Constants - Replace with your actual credentials
- */
-const COMETCHAT_CONSTANTS = {
- APP_ID: "APP_ID", // Replace with your actual App ID from CometChat
- REGION: "REGION", // Replace with your App's Region
- AUTH_KEY: "AUTH_KEY", // Replace with your Auth Key (leave blank if using Auth Token)
-};
-
-const UIKitSettings = new UIKitSettingsBuilder()
- .setAppId(COMETCHAT_CONSTANTS.APP_ID)
- .setRegion(COMETCHAT_CONSTANTS.REGION)
- .setAuthKey(COMETCHAT_CONSTANTS.AUTH_KEY)
- .subscribePresenceForAllUsers()
- .build();
-
-CometChatUIKit.init(UIKitSettings)
- ?.then(() => {
- console.log("CometChat UI Kit initialized successfully.");
- })
- .catch((error) => {
- console.error("CometChat UI Kit initialization failed:", error);
- });
-```
-
-
-```js lines highlight={7-9}
-import { CometChatUIKit, UIKitSettingsBuilder } from "@cometchat/chat-uikit-react";
-
-/**
- * CometChat Constants - Replace with your actual credentials
- */
-const COMETCHAT_CONSTANTS = {
- APP_ID: "APP_ID", // Replace with your actual App ID from CometChat
- REGION: "REGION", // Replace with your App's Region
- AUTH_KEY: "AUTH_KEY", // Replace with your Auth Key (leave blank if using Auth Token)
-};
-
-const UIKitSettings = new UIKitSettingsBuilder()
- .setAppId(COMETCHAT_CONSTANTS.APP_ID)
- .setRegion(COMETCHAT_CONSTANTS.REGION)
- .setAuthKey(COMETCHAT_CONSTANTS.AUTH_KEY)
- .subscribePresenceForAllUsers()
- .build();
-
-CometChatUIKit.init(UIKitSettings)
- .then(() => {
- console.log("CometChat UI Kit initialized successfully.");
- })
- .catch((error) => {
- console.error("CometChat UI Kit initialization failed:", error);
- });
-```
-
-
-
-
-`init()` must resolve before you call `login()`. If you call `login()` before init completes, it will fail silently. Note the `?.then()` — in Next.js, `init()` may return `undefined` if settings are invalid.
-
-
----
-
-## Step 4 — Login
-
-After init resolves, log the user in. For development, use one of the pre-created test UIDs:
-
-`cometchat-uid-1` · `cometchat-uid-2` · `cometchat-uid-3` · `cometchat-uid-4` · `cometchat-uid-5`
-
-
-
-```ts lines highlight={3}
-import { CometChatUIKit } from "@cometchat/chat-uikit-react";
-
-const UID = "UID"; // Replace with your actual UID
-
-CometChatUIKit.getLoggedinUser().then((user: CometChat.User | null) => {
- if (!user) {
- CometChatUIKit.login(UID)
- .then((user: CometChat.User) => {
- console.log("Login Successful:", { user });
- // Mount your app
- })
- .catch(console.log);
- } else {
- // Already logged in — mount your app
- }
-});
-```
-
-
-```js lines highlight={3}
-import { CometChatUIKit } from "@cometchat/chat-uikit-react";
-
-const UID = "UID"; // Replace with your actual UID
-
-CometChatUIKit.getLoggedinUser().then((user) => {
- if (!user) {
- CometChatUIKit.login(UID)
- .then((user) => {
- console.log("Login Successful:", { user });
- // Mount your app
- })
- .catch(console.log);
- } else {
- // Already logged in — mount your app
- }
-});
-```
-
-
-
-Key points:
-- `getLoggedinUser()` checks for an existing session so you don't re-login unnecessarily.
-- `login(uid)` skips the API call if a session already exists and returns the cached user.
-- Components must not render until login resolves — use a state flag to gate rendering.
-
-
-For production, use [`loginWithAuthToken()`](/ui-kit/react/methods#login-using-auth-token) instead of Auth Key. Generate tokens server-side via the REST API.
-
-
----
-
-## Step 5 — Add the CSS Import
-
-Add this line at the top of your global CSS file (e.g. `globals.css`):
-
-```css title="globals.css" lines
-@import url("@cometchat/chat-uikit-react/css-variables.css");
-```
-
-Also ensure your global CSS sets `height: 100%` on the root elements:
-
-```css title="globals.css" lines
-html,
-body {
- height: 100%;
-}
-
-#__next {
- height: 100%;
-}
-```
-
-Without the CSS import, components will render with broken or missing styles. Without the height rules, the chat UI won't fill the viewport.
-
----
-
-## Step 6 — Choose a Chat Experience
-
-Integrate a conversation view that suits your app's UX. Each option below includes a live CodeSandbox demo and a step-by-step guide.
-
-### Conversation List + Message View
-
-Two-panel layout — conversation list on the left, messages on the right. Think WhatsApp Web or Slack.
-
-- Two-panel layout with conversation list and active chat window
-- Switch between one-to-one and group conversations
-- Tap-to-view on mobile — tapping a conversation opens the message view
-- Real-time updates and message sync across sessions
-
-
-
-
-
-[](https://link.cometchat.com/next-conversation-list-message)
-
-> Fork the sandbox, insert your CometChat credentials (App ID, Region, Auth Key), and preview the UI in real time.
-
-
- Step-by-step guide to build this layout
-
-
----
-
-### One-to-One / Group Chat
-
-Single chat window — no sidebar. Good for support chat, embedded widgets, or focused messaging.
-
-- Dedicated chat window for one-on-one or group messaging
-- No conversation list — users go directly into the chat
-- Full-screen experience optimized for mobile
-- Ideal for support chat or community messaging
-
-
-
-
-
-[](https://link.cometchat.com/next-one-on-one)
-
-> Fork the sandbox, insert your CometChat credentials (App ID, Region, Auth Key), and preview the UI in real time.
-
-
- Step-by-step guide to build this layout
-
-
----
-
-### Tab-Based Chat
-
-Tabbed navigation — Chat, Call Logs, Users, Settings in separate tabs. Good for full-featured apps.
-
-- Tab navigation between Chat, Call Logs, Users, and Settings
-- Full-screen messaging within each tab
-- Unified experience for conversations, call history, and settings
-- Scales well for adding future features like notifications or contacts
-
-
-
-
-
-[](https://link.cometchat.com/next-tabs-sidebar-message)
-
-> Fork the sandbox, insert your CometChat credentials (App ID, Region, Auth Key), and preview the UI in real time.
-
-
- Step-by-step guide to build this layout
-
-
----
-
-## Build Your Own Chat Experience
-
-Need full control over the UI? Use individual components, customize themes, and wire up your own layouts.
-
-- [Sample App](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app) — Working reference app to compare against
-- [Components](/ui-kit/react/components-overview) — All prebuilt UI elements with props and customization options
-- [Core Features](/ui-kit/react/core-features) — Messaging, real-time updates, and other capabilities
-- [Theming](/ui-kit/react/theme) — Colors, fonts, dark mode, and custom styling
-- [Build Your Own UI](/sdk/javascript/overview) — Skip the UI Kit entirely and build on the raw SDK
-
----
-
-## Next Steps
-
-
-
- Browse all prebuilt UI components
-
-
- Customize colors, fonts, and styles
-
-
- Chat features included out of the box
-
-
- Common issues and fixes
-
-
diff --git a/ui-kit/react/next-one-to-one-chat.mdx b/ui-kit/react/next-one-to-one-chat.mdx
index 9f9878096..8d743a646 100644
--- a/ui-kit/react/next-one-to-one-chat.mdx
+++ b/ui-kit/react/next-one-to-one-chat.mdx
@@ -1,7 +1,7 @@
---
title: "One-to-One / Group Chat"
sidebarTitle: "One-to-One / Group Chat"
-description: "Build focused CometChat UI Kit chat screens in Next.js with headers, message lists, composers, users, groups, and direct navigation."
+description: "Build a single chat window for one-to-one or group messaging in Next.js (App Router) with CometChat UI Kit."
---
@@ -9,26 +9,23 @@ description: "Build focused CometChat UI Kit chat screens in Next.js with header
| Field | Value |
| --- | --- |
| Package | `@cometchat/chat-uikit-react` |
-| Framework | Next.js |
+| Framework | Next.js (App Router) |
| Components | `CometChatMessageHeader`, `CometChatMessageList`, `CometChatMessageComposer` |
| Layout | Single chat window — no sidebar, no conversation list |
-| Prerequisite | Complete [Next.js Integration](/ui-kit/react/next-js-integration) Steps 1–5 first |
-| SSR | Dynamic import with `ssr: false` — CometChat requires browser APIs |
+| Prerequisite | Complete [Next.js Integration](/ui-kit/react/integration-nextjs) first |
+| SSR | Component loaded with `dynamic(() => import(...), { ssr: false })` |
| Pattern | Support chat, embedded widgets, focused messaging |
This guide builds a single chat window — no sidebar, no conversation list. Users go directly into a one-to-one or group chat. Good for support chat, embedded widgets, or any focused messaging experience.
-This assumes you've already completed [Next.js Integration](/ui-kit/react/next-js-integration) (project created, UI Kit installed, CSS imported).
+This assumes you've already completed [Next.js Integration](/ui-kit/react/integration-nextjs) (project created, UI Kit installed, init + login working).
-
+
-[](https://link.cometchat.com/next-one-on-one)
-
-> Fork the sandbox, insert your CometChat credentials (App ID, Region, Auth Key), and preview the UI in real time.
---
@@ -42,222 +39,157 @@ Three components stacked vertically:
---
-## Step 1 — Create the CometChatNoSSR Component
-
-This component handles init, login, fetches the target user/group, and renders the chat UI. It runs client-side only.
+## Full Code
-
-
-
-
-
-
-
-
-
-
+Create the client component with the chat UI, then import it dynamically in your page.
-
-
+```tsx title="app/chat/CometChatClient.tsx"
+'use client';
-```tsx title="CometChatNoSSR.tsx" lines highlight={13-15, 19}
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
import {
- CometChatMessageComposer,
- CometChatMessageHeader,
- CometChatMessageList,
CometChatUIKit,
UIKitSettingsBuilder,
+ CometChatProvider,
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
} from "@cometchat/chat-uikit-react";
-import { CometChat } from "@cometchat/chat-sdk-javascript";
-import "./CometChatNoSSR.css";
-const COMETCHAT_CONSTANTS = {
- APP_ID: "", // Replace with your App ID
- REGION: "", // Replace with your Region
- AUTH_KEY: "", // Replace with your Auth Key (dev only)
-};
+const RECIPIENT_UID = "cometchat-uid-2"; // Replace with the UID you want to chat with
-// Fetch the user whose chat you want to load
-const UID = "cometchat-uid-1";
-
-const CometChatNoSSR: React.FC = () => {
- const [user, setUser] = useState(undefined);
- const [selectedUser, setSelectedUser] = useState(undefined);
- const [selectedGroup, setSelectedGroup] = useState(undefined);
+export default function CometChatClient() {
+ const [ready, setReady] = useState(false);
+ const [chatUser, setChatUser] = useState(undefined);
useEffect(() => {
- const UIKitSettings = new UIKitSettingsBuilder()
- .setAppId(COMETCHAT_CONSTANTS.APP_ID)
- .setRegion(COMETCHAT_CONSTANTS.REGION)
- .setAuthKey(COMETCHAT_CONSTANTS.AUTH_KEY)
+ const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
.subscribePresenceForAllUsers()
.build();
- CometChatUIKit.init(UIKitSettings)
- ?.then(() => {
- console.log("Initialization completed successfully");
- CometChatUIKit.getLoggedinUser().then((loggedInUser) => {
- if (!loggedInUser) {
- CometChatUIKit.login("cometchat-uid-2")
- .then((user) => {
- console.log("Login Successful", { user });
- setUser(user);
- })
- .catch((error) => console.error("Login failed", error));
- } else {
- console.log("Already logged-in", { loggedInUser });
- setUser(loggedInUser);
- }
- });
- })
- .catch((error) => console.error("Initialization failed", error));
+ CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ const user = await CometChat.getUser(RECIPIENT_UID);
+ setChatUser(user);
+ setReady(true);
+ });
}, []);
- useEffect(() => {
- if (user) {
- CometChat.getUser(UID).then(
- (user) => setSelectedUser(user),
- (error) => console.log("User fetching failed with error:", error)
- );
-
- // To load a group chat instead, uncomment below:
- // const GUID = "GUID";
- // CometChat.getGroup(GUID).then(
- // (group) => setSelectedGroup(group),
- // (error) => console.log("Group fetching failed with error:", error)
- // );
- }
- }, [user]);
-
- return user ? (
- <>
- {selectedUser || selectedGroup ? (
-
-
-
-
-
- ) : (
-
- Set a user or group UID in CometChatNoSSR.tsx to start chatting
-
+
+ );
+}
```
-
-
+```tsx title="app/chat/page.tsx"
+import dynamic from 'next/dynamic';
-```css title="CometChatNoSSR.css" lines
-.messages-wrapper {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
-}
+const CometChatClient = dynamic(() => import('./CometChatClient'), { ssr: false });
-.empty-conversation {
- height: 100%;
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- background: white;
- color: var(--cometchat-text-color-secondary, #727272);
- font: var(--cometchat-font-body-regular, 400 14px Roboto);
-}
-
-.cometchat .cometchat-message-composer {
- border-radius: 0px;
+export default function ChatPage() {
+ return ;
}
```
-
-
-
Key points:
-- `CometChat.getUser(UID)` fetches the user object from the SDK — you need a real user object, not a manually constructed one.
+- `'use client'` is required — CometChat components use browser APIs (DOM, WebSocket).
+- `dynamic(() => import(...), { ssr: false })` prevents server-side rendering of the chat component.
+- `CometChat.getUser(UID)` fetches the full user object from the SDK — you need a real user object, not a manually constructed one.
- Pass either `user` or `group` to the message components, never both.
-- The highlighted lines show where to set your credentials.
+- The `RECIPIENT_UID` should be a user that exists in your CometChat app. Use one of the pre-created test UIDs: `cometchat-uid-1` through `cometchat-uid-5`.
---
-## Switching Between User and Group Chat
+## Switching to Group Chat
-To load a group chat instead of one-to-one, replace the `getUser` call with `getGroup`:
+To load a group chat instead of one-to-one, fetch a `Group` object and pass it to the message components:
-```tsx highlight={1} lines
-const GUID = "GUID"; // Replace with your actual Group ID
-
-CometChat.getGroup(GUID)
- .then((group) => setSelectedGroup(group))
- .catch((error) => console.error("Failed to fetch group:", error));
-```
+```tsx title="app/chat/CometChatClient.tsx"
+'use client';
----
+import { useEffect, useState } from "react";
+import { CometChat } from "@cometchat/chat-sdk-javascript";
+import {
+ CometChatUIKit,
+ UIKitSettingsBuilder,
+ CometChatProvider,
+ CometChatMessageHeader,
+ CometChatMessageList,
+ CometChatMessageComposer,
+} from "@cometchat/chat-uikit-react";
-## Step 2 — Disable SSR in Your Page
+const GROUP_ID = "cometchat-guid-1"; // Replace with your Group ID
-Dynamically import `CometChatNoSSR` with `ssr: false` so it only loads client-side.
+export default function CometChatClient() {
+ const [ready, setReady] = useState(false);
+ const [chatGroup, setChatGroup] = useState(undefined);
-```tsx title="index.tsx" lines
-import dynamic from "next/dynamic";
-import "@cometchat/chat-uikit-react/css-variables.css";
+ useEffect(() => {
+ const settings = new UIKitSettingsBuilder()
+ .setAppId("YOUR_APP_ID")
+ .setRegion("YOUR_REGION")
+ .setAuthKey("YOUR_AUTH_KEY")
+ .subscribePresenceForAllUsers()
+ .build();
-const CometChatComponent = dynamic(
- () => import("../CometChatNoSSR/CometChatNoSSR"),
- { ssr: false }
-);
+ CometChatUIKit.init(settings).then(async () => {
+ await CometChatUIKit.login("cometchat-uid-1");
+ const group = await CometChat.getGroup(GROUP_ID);
+ setChatGroup(group);
+ setReady(true);
+ });
+ }, []);
-export default function Home() {
- return ;
+ if (!ready || !chatGroup) return
Loading chat...
;
+
+ return (
+
+
+
+
+
+
+
+ );
}
```
+The only difference: use `CometChat.getGroup(GUID)` instead of `CometChat.getUser(UID)`, and pass `group` instead of `user`.
+
---
-## Step 3 — Run the Project
+## Run
-
-
-```bash lines
+```bash
npm run dev
```
-
-
-```bash lines
-pnpm dev
-```
-
-
-```bash lines
-yarn dev
-```
-
-
-You should see the chat window load with the conversation for the UID you set.
+Open `http://localhost:3000/chat`. You should see the chat window load with the conversation for the UID or GUID you set.
---
## Next Steps
-
- Customize colors, fonts, and styles to match your brand
+
+ Two-panel layout with a sidebar
+
+
+ Tabbed navigation with Chats, Calls, Users
Browse all prebuilt UI components
- } href="/ui-kit/react/next-js-integration">
- Back to the main setup guide
-
-
- Chat features included out of the box
-
diff --git a/ui-kit/react/next-tab-based-chat.mdx b/ui-kit/react/next-tab-based-chat.mdx
index 06a788584..35b9649ed 100644
--- a/ui-kit/react/next-tab-based-chat.mdx
+++ b/ui-kit/react/next-tab-based-chat.mdx
@@ -1,7 +1,7 @@
---
title: "Tab-Based Chat"
sidebarTitle: "Tab-Based Chat"
-description: "Build a tab-based messaging UI with chats, calls, users, and groups in Next.js with CometChat UI Kit."
+description: "Build a tab-based chat interface with Chat, Call Logs, and Users tabs in Next.js (App Router)."
---
@@ -9,26 +9,23 @@ description: "Build a tab-based messaging UI with chats, calls, users, and group
| Field | Value |
| --- | --- |
| Package | `@cometchat/chat-uikit-react` |
-| Framework | Next.js |
-| Components | `CometChatConversations`, `CometChatCallLogs`, `CometChatUsers`, `CometChatGroups`, `CometChatMessageHeader`, `CometChatMessageList`, `CometChatMessageComposer` |
-| Layout | Tabbed sidebar (Chats, Calls, Users, Groups) + message view |
-| Prerequisite | Complete [Next.js Integration](/ui-kit/react/next-js-integration) Steps 1–5 first |
-| SSR | Dynamic import with `ssr: false` — CometChat requires browser APIs |
+| Framework | Next.js (App Router) |
+| Components | `CometChatConversations`, `CometChatCallLogs`, `CometChatUsers`, `CometChatMessageHeader`, `CometChatMessageList`, `CometChatMessageComposer` |
+| Layout | Tabbed sidebar (Chat, Calls, Users) + message view |
+| Prerequisite | Complete [Next.js Integration](/ui-kit/react/integration-nextjs) first |
+| SSR | Component loaded with `dynamic(() => import(...), { ssr: false })` |
| Pattern | Full-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 guide builds a tabbed messaging UI — Chat, Calls, and Users 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 [Next.js Integration](/ui-kit/react/next-js-integration) (project created, UI Kit installed, CSS imported).
+This assumes you've already completed [Next.js Integration](/ui-kit/react/integration-nextjs) (project created, UI Kit installed, init + login working).
-
+
-[](https://link.cometchat.com/next-tabs-sidebar-message)
-
-> Fork the sandbox, insert your CometChat credentials (App ID, Region, Auth Key), and preview the UI in real time.
---
@@ -36,573 +33,288 @@ This assumes you've already completed [Next.js Integration](/ui-kit/react/next-j
Three sections working together:
-1. **Tab bar** — switches between Chats, Calls, Users, and Groups
+1. **Tab bar** — switches between Chat, Calls, and Users
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
-
-
-
-
-
-
-
-
-
-
-
-
-Tab icons need to be placed in `public/assets/`. Download them from the [CometChat UI Kit assets folder on GitHub](https://github.com/cometchat/cometchat-uikit-react/tree/v6/sample-app/src/assets).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```tsx title="CometChatTabs.tsx" lines
-import { useState } from "react";
-import "./CometChatTabs.css";
-
-const chatsIcon = "/assets/chats.svg";
-const callsIcon = "/assets/calls.svg";
-const usersIcon = "/assets/users.svg";
-const groupsIcon = "/assets/groups.svg";
-
-export const CometChatTabs = (props: {
- onTabClicked?: (tabItem: { name: string; icon?: string }) => void;
- activeTab?: string;
-}) => {
- const { onTabClicked = () => {}, activeTab } = props;
- const [hoverTab, setHoverTab] = useState("");
-
- const tabItems = [
- { name: "CHATS", icon: chatsIcon },
- { name: "CALLS", icon: callsIcon },
- { name: "USERS", icon: usersIcon },
- { name: "GROUPS", icon: groupsIcon },
- ];
-
- return (
-