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


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

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:

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.

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

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

Preloading

The AI Assistant Chat panel can be preloaded on hover/focus to reduce perceived latency: