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.

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.
import { CometChatMessageBubble } from "@cometchat/chat-uikit-react";
import { CometChatTextBubble } from "@cometchat/chat-uikit-react/plugins/core/text";

function MessageItem({ message, alignment }) {
  return (
    <CometChatMessageBubble
      message={message}
      alignment={alignment}
      contentView={
        <CometChatTextBubble text={message.getText()} isSentByMe={alignment === "right"} />
      }
    />
  );
}

Shared Chrome Elements

ElementWhen ShownSource
AvatarIncoming + group + !hideAvatarmessage.getSender().getAvatar()
Sender nameIncoming + group + !hideSenderNamemessage.getSender().getName()
Bubble backgroundAlwaysType-specific: primary for outgoing, neutral for incoming
Timestamp!hideTimestampmessage.getSentAt() via CometChatDate
ReceiptsOutgoing + !hideReceiptsmessage.getReadAt() / getDeliveredAt()
Edited indicatormessage.getEditedAt() truthy”(edited)” text
Thread repliesmessage.getReplyCount() > 0 + !hideThreadViewReply count button
Context menuoptions.length > 0 + !disableInteractionHover/click

GlobalConfig Integration

hideReceipts reads from GlobalConfigContext when the prop is not explicitly set:
<GlobalConfigProvider config={{ hideReceipts: true }}>
  {/* All bubbles hide receipts unless overridden */}
  <CometChatMessageBubble hideReceipts={false} ... />  {/* This one shows receipts */}
</GlobalConfigProvider>

Props

message

The SDK message object. Required.
TypeCometChat.BaseMessage

alignment

Bubble alignment: 'left' (incoming), 'right' (outgoing), 'center' (action).
Type'left' | 'right' | 'center'

contentView

The inner content from the plugin’s renderBubble(). Required.
TypeReactNode

group

Group context. Enables avatar and sender name display.
TypeCometChat.Group
Defaultundefined

hideAvatar / hideSenderName / hideTimestamp / hideThreadView

Per-bubble display controls. Not in GlobalConfig.
Typeboolean
Defaultfalse

hideReceipts

Hide receipt indicators. Reads from GlobalConfig if not set.
Typeboolean
Defaultundefined (falls back to GlobalConfig, then false)

showError

Show error receipt icon instead of normal receipts.
Typeboolean
Defaultfalse

disableInteraction

Disable hover options and keyboard interactions.
Typeboolean
Defaultfalse

CSS Selectors

TargetSelector
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