AI Integration Quick Reference
AI Integration Quick Reference
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
Props
message
The message to render. Whentext is omitted, the bubble extracts the content and mention formatting from it.
| Type | CometChat.BaseMessage |
| Default | undefined |
text
Explicit text to display. Overridesmessage.getText() when provided.
| Type | string |
| Default | undefined |
isSentByMe
Whether the message was sent by the logged-in user (affects styling).| Type | boolean |
| Default | true |
textFormatters
Text formatters to apply (mentions, URLs, custom syntax).| Type | CometChatTextFormatter[] |
| Default | undefined |
disableTruncation
Disable the read-more / show-less truncation.| Type | boolean |
| Default | false |
className
Additional CSS class applied to the root element.| Type | string |
| Default | undefined |
CSS Selectors
| Target | Selector |
|---|---|
| Root | .cometchat-text-bubble |
| Incoming / outgoing | .cometchat-text-bubble--incoming / .cometchat-text-bubble--outgoing |
| Single emoji | .cometchat-text-bubble--single-emoji |
| Text content | .cometchat-text-bubble__text |
| Mention chip | .cometchat-text-bubble__mention |
| Link | .cometchat-link |
| Read-more button | .cometchat-text-bubble__read-more-button |
| Link preview | .cometchat-text-bubble__link-preview |
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