Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-react-uikit-v7.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

{
  "component": "CometChatTypingIndicator",
  "package": "@cometchat/chat-uikit-react",
  "import": "import { CometChatTypingIndicator } from \"@cometchat/chat-uikit-react\";",
  "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
  "description": "Animated typing status display for 1-on-1 and group chat contexts with bouncing dots.",
  "cssRootClass": ".cometchat-typing-indicator",
  "primaryOutput": null,
  "props": {
    "data": {
      "typingNames": { "type": "string[]", "required": true, "note": "SDK-agnostic user display names" },
      "isGroupChat": { "type": "boolean", "default": "false" }
    },
    "callbacks": {}
  },
  "events": [],
  "sdkListeners": [],
  "types": {}
}

Where It Fits

CometChatTypingIndicator is a base display component used by CometChatMessageHeader (typing status below the conversation name) and CometChatConversations (typing status in conversation subtitle). It is SDK-agnostic — the parent maps CometChat.TypingIndicator objects to plain name strings before passing them in.
import { CometChatTypingIndicator } from "@cometchat/chat-uikit-react";
import "@cometchat/chat-uikit-react/css-variables.css";

// In a message header component:
function MessageHeader({ typingIndicators, isGroup }) {
  const names = typingIndicators.map((t) => t.getSender().getName());

  return (
    <header>
      <h2>Conversation Title</h2>
      {names.length > 0 && (
        <CometChatTypingIndicator typingNames={names} isGroupChat={isGroup} />
      )}
    </header>
  );
}

Minimal Render

import { CometChatTypingIndicator } from "@cometchat/chat-uikit-react";
import "@cometchat/chat-uikit-react/css-variables.css";

function TypingDemo() {
  return <CometChatTypingIndicator typingNames={["Alice"]} />;
}

export default TypingDemo;
Root CSS class: .cometchat-typing-indicator

Display Logic

The component renders different text based on the chat context and number of typing users:
isGroupChatUsers typingDisplay
false1+typing…
true1 is typing…
true2 and are typing…
true3+Multiple people are typing…
any0renders nothing
All cases include animated bouncing dots after the text.

Common Patterns

1-on-1 chat

import { CometChatTypingIndicator } from "@cometchat/chat-uikit-react";

function OneOnOneTyping() {
  return <CometChatTypingIndicator typingNames={["Alice"]} isGroupChat={false} />;
}

Group chat — single user

import { CometChatTypingIndicator } from "@cometchat/chat-uikit-react";

function GroupSingleTyping() {
  return <CometChatTypingIndicator typingNames={["Bob"]} isGroupChat />;
}

Group chat — multiple users

import { CometChatTypingIndicator } from "@cometchat/chat-uikit-react";

function GroupMultipleTyping() {
  return (
    <CometChatTypingIndicator
      typingNames={["Alice", "Bob", "Charlie"]}
      isGroupChat
    />
  );
}

CSS Architecture

The component uses CSS custom properties (design tokens) defined in @cometchat/chat-uikit-react/css-variables.css.

Key Selectors

TargetSelector
Root.cometchat-typing-indicator
Content wrapper.cometchat-typing-indicator__content
Text.cometchat-typing-indicator__text
User name (bold).cometchat-typing-indicator__name
Dots container.cometchat-typing-indicator__dots
Individual dot.cometchat-typing-indicator__dot

Example: Custom dot color

.cometchat .cometchat-typing-indicator .cometchat-typing-indicator__dot {
  background-color: #6852d6;
}

.cometchat .cometchat-typing-indicator .cometchat-typing-indicator__text {
  color: #6852d6;
}

Customization Matrix

What to changeWhereProperty/APIExample
Set typing usersComponent propstypingNamestypingNames={['Alice']}
Set chat contextComponent propsisGroupChatisGroupChat={true}
Change text/dot colorsGlobal CSS.cometchat-typing-indicator selectorsSee example above

Props


typingNames

Display names of users currently typing. Empty array renders nothing.
Typestring[]
RequiredYes
The component is SDK-agnostic. The parent maps SDK TypingIndicator objects to name strings.

className

Custom CSS class applied to the root element.
Typestring
Defaultundefined

isGroupChat

Whether this is a group conversation. Affects the display text format.
Typeboolean
Defaultfalse

CSS Selectors

TargetSelector
Root.cometchat-typing-indicator
Content wrapper.cometchat-typing-indicator__content
Text.cometchat-typing-indicator__text
User name.cometchat-typing-indicator__name
Dots container.cometchat-typing-indicator__dots
Individual dot.cometchat-typing-indicator__dot
Dot animation@keyframes cometchat-typing-indicator-bounce