Skip to main content

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 ↗
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

GlobalConfig Integration

hideReceipts reads from GlobalConfigContext when the prop is not explicitly set:

Props

message

The SDK message object. Required.

alignment

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

contentView

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

group

Group context. Enables avatar and sender name display.

hideAvatar / hideSenderName / hideTimestamp / hideThreadView

Per-bubble display controls. Not in GlobalConfig.

hideReceipts

Hide receipt indicators. Reads from GlobalConfig if not set.

showError

Show error receipt icon instead of normal receipts.

disableInteraction

Disable hover options and keyboard interactions.

options

Context menu options for this message (the hover/overflow actions).

quickOptionsCount

Number of quick options shown directly; the rest move to the overflow menu.

forceShowAvatar

Force-show the avatar for incoming messages even in 1:1 chats (used by agent chat).

messageSentAtDateTimeFormat

Override the date format for the sent-at timestamp shown beside the bubble.

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.

Callback props


Accessibility & advanced props

CSS Selectors