Skip to main content

What is a Plugin?

A plugin owns one or more message types. It tells the UI Kit:
  • How to render the message as a bubble in the message list
  • What context menu options to show when a user hovers/long-presses a message
  • What preview text to display in the Conversations list subtitle
Every message that appears in the UI is rendered by a plugin. If no plugin matches a message type, the message is not displayed. Plugins are a thin routing layer — they decide which bubble component renders a message and provide context menu options and conversation previews. The bubble components themselves are standalone and documented under Message Bubbles; this page links each plugin to its component instead of repeating that detail.

Where Plugins Are Used

LocationPlugin MethodWhat it does
Message ListrenderBubble()Routes to the appropriate bubble component (e.g., CometChatTextBubble, CometChatImageBubble)
Message ListgetOptions()Provides context menu items (reply, edit, delete, copy, react)
Conversations ListgetLastMessagePreview()Returns subtitle text (”📷 Photo”, “You: Hello”, ”🎥 Video”)
Message BubblerenderHeaderView(), renderFooterView(), etc.Customizes bubble regions beyond content

The Plugin Interface

Every plugin implements the CometChatMessagePlugin interface. Three members are required; everything else is optional and lets you override a specific bubble region or behavior.
MemberSignatureRequiredPurpose
idstringYesUnique plugin identifier (e.g. 'text', 'polls')
messageTypesstring[]YesSDK message types this plugin handles
messageCategoriesstring[]YesSDK message categories this plugin handles
renderBubble(message, context) => ReactNodeYesRender the inner bubble content (the outer wrapper is handled by CometChatMessageBubble)
getOptions(message, context) => CometChatMessageOption[]OptionalContext menu options for the message (return [] for none)
getLastMessagePreview(message, loggedInUser, t?) => stringOptionalPlain-text subtitle shown in the Conversations list
getTextFormatters() => CometChatTextFormatter[]OptionalText formatters this plugin provides (only the text plugin uses this)
renderLeadingView(message, context) => ReactNodeOptionalOverride the leading view (avatar area)
renderHeaderView(message, context) => ReactNodeOptionalOverride the header view (sender name area)
renderFooterView(message, context) => ReactNodeOptionalOverride the footer view (reactions area)
renderBottomView(message, context) => ReactNodeOptionalOverride the bottom view (moderation / error footer)
renderStatusInfoView(message, context) => ReactNodeOptionalOverride the status info (timestamp + receipts + “edited”)
renderReplyView(message, context) => ReactNodeOptionalOverride the reply view (quoted-message preview)
renderThreadView(message, context) => ReactNodeOptionalOverride the thread view (reply-count indicator)
For the view-slot methods (render*View), return a ReactNode to override the region, null to suppress it, or undefined to keep the built-in default. The full TypeScript interface and the context object reference are documented in Creating a Custom Plugin.

How Plugin Resolution Works

When the UI Kit needs to render a message, it asks the Plugin Registry to find the right plugin:
  1. If the message is deleted (getDeletedAt() !== null), the Delete plugin handles it
  2. Otherwise, the registry finds the first plugin whose messageTypes includes the message’s type AND whose messageCategories includes the message’s category
  3. First match wins — plugin order matters
Message { type: "image", category: "message" }
  → Registry scans plugins in order
  → CometChatImagePlugin matches (messageTypes: ["image"], messageCategories: ["message"])
  → ImagePlugin.renderBubble() is called

Adding Plugins

All default plugins are always included. To add your own custom plugins, pass them via the plugins prop on CometChatProvider. They are appended after the defaults, so default plugins keep priority for their message types:
import { CometChatProvider } from "@cometchat/chat-uikit-react";
import { MyCustomPlugin } from "./plugins/MyCustomPlugin";

function App() {
  return (
    <CometChatProvider plugins={[MyCustomPlugin]}>
      <MyChatApp />
    </CometChatProvider>
  );
}

Built-in Plugins

These plugins are included automatically — no configuration needed. Each routes its message type to a bubble component; follow the component link for the full rendering behavior, props, and CSS.
PluginMessage type(s)CategoryWhat it rendersComponent
TexttextmessageFormatted text with @mentions, clickable URLs, and markdownText Bubble
ImageimagemessageResponsive image grid with captions and a fullscreen viewerImage Bubble
VideovideomessageInline player (single) or thumbnail grid with play overlays (multiple)Video Bubble
FilefilemessageFile card with name, size, type icon, and downloadFile Bubble
AudioaudiomessageAudio player with waveform, play/pause, duration, and downloadAudio Bubble
Pollsextension_pollcustomInteractive poll with voting and live resultsPoll Bubble
Stickersextension_stickercustomSticker image extracted from the message metadataSticker Bubble
Collaborative Documentextension_documentcustomDocument card with an “Open Document” buttonCollaborative Document Bubble
Collaborative Whiteboardextension_whiteboardcustomWhiteboard card with an “Open Whiteboard” buttonCollaborative Whiteboard Bubble
Group ActiongroupMemberactionCentered system messages (joined, left, kicked, banned, scope change)Group Action Bubble
Call Actionaudio / videocallCentered call status messages (missed, outgoing, incoming, ended)Call Action Bubble
AIassistant, toolArguments, toolResults, run_startedagentic, customAI assistant responses, tool call arguments/results, and a streaming bubbleAI Plugin ↓
Deleteany (deleted)any”This message was deleted” placeholderDelete Bubble

AI Plugin

The AI plugin handles messages in the agentic category. It renders completed assistant responses (with markdown), tool call arguments and results (as formatted JSON), and a streaming bubble while the AI is generating. It is included by default — no installation or plugins configuration is required.

Message Types

TypeCategoryWhat it renders
assistantagenticCompleted AI response with markdown
toolArgumentsagenticTool call arguments as formatted JSON
toolResultsagenticTool call results as formatted JSON
run_startedcustomStreaming placeholder while the AI generates
Bubble components: CometChatAIAssistantBubble, CometChatStreamMessageBubble, CometChatToolCallArgumentBubble, CometChatToolCallResultBubble. AI messages are system-generated and have no context menu. For the full chat experience, see AI Assistant Chat.

Conversation Preview

TypePreview text
assistantFirst 80 characters of the response (markdown stripped)
toolArguments”Tool call”
toolResults”Tool result”

Preloading

The AI Assistant Chat panel can be preloaded on hover/focus to reduce perceived latency:
import { preloadAIAssistantChat } from "@cometchat/chat-uikit-react";

// Call on AI button hover
onMouseEnter={() => preloadAIAssistantChat()}