Skip to main content

Overview

CometChatTextBubble renders a text message. It is self-extracting: pass the SDK message and the bubble reads the text via message.getText() and configures mention formatting from the message itself, so it works standalone. It also accepts an explicit text override, which is how media bubbles render their captions through it. Text is run through the formatter pipeline — markdown (**bold**, _italic_, ~~strike~~, `code`, lists, blockquotes), <@uid:xxx> mentions resolved to styled chips, and bare URLs converted to clickable links. Long messages are truncated with a “Read more” toggle unless disableTruncation is set.
Live Preview — interact with the text bubble.Open in Storybook ↗

Usage

Render explicit text (e.g. a caption) instead of extracting from a message:

Props

message

The message to render. When text is omitted, the bubble extracts the content and mention formatting from it.

text

Explicit text to display. Overrides message.getText() when provided.

isSentByMe

Whether the message was sent by the logged-in user (affects styling).

textFormatters

Text formatters to apply (mentions, URLs, custom syntax).

disableTruncation

Disable the read-more / show-less truncation.

className

Additional CSS class applied to the root element.

CSS Selectors


Next Steps

Text Plugin

Plugin behavior, context menu, and conversation preview

Text Formatters

Build custom mention / URL / markdown formatters

Message Bubble

The wrapper that hosts bubble content

Theming

Customize colors, fonts, and spacing