Skip to main content

Overview

A CometChatMessageTemplate provides the capability to define and customize both the structure and behavior of message bubbles. It acts as a blueprint for creating message bubble widgets, allowing you to manage appearance and interactions consistently.

Structure

The MessageBubble structure can be broken down into:
  1. Leading widget — Sender’s avatar
  2. Header widget — Sender’s name (useful in group chats)
  3. Content widget — Message content (text, images, videos, etc.)
  4. Bottom widget — Additional elements like link previews or “load more” buttons
  5. Footer widget — Timestamp and delivery/read status

Properties

Customization

Header Widget


Content Widget


Bottom Widget



Options List


New Templates

Create entirely new templates for custom message types:
In V6, CometChatUIKit.getDataSource() is replaced by MessageTemplateUtils for accessing data source methods. Use the appropriate service locator to get message options and templates.