Skip to main content

Where It Fits

CometChatMessageList is a Composite Widget that displays a list of messages and effectively manages real-time operations. It includes various types of messages such as Text Messages, Media Messages, Stickers, and more. CometChatMessageList is primarily a list of the base widget MessageBubble. The MessageBubble Widget is utilized to create different types of chat bubbles depending on the message type.

Minimal Render

The simplest way to render CometChatMessageList:
Simply adding the MessageList component to the layout will only display the loading indicator. To fetch messages for a specific entity, you need to supplement it with User or Group Object.

Filtering CometChatMessageList

Use the messagesRequestBuilder prop to filter which messages appear in the list.

Filter Recipes

The following parameters in messageRequestBuilder will always be altered inside the message list:
  1. UID
  2. GUID
  3. types
  4. categories
For the full MessagesRequestBuilder API, see the SDK documentation.

Actions and Events

Callback Props

Component-level callbacks that fire on specific user interactions:

SDK Events (Real-Time, Automatic)

The component automatically handles these SDK listeners for real-time updates:

Custom View Slots

Customize the appearance of CometChatMessageList by replacing default views with your own widgets.

Example: Custom Header View

Example: Custom Loading State View

Example: Custom Empty State View

Example: Custom Error State View

Styling

Customize the appearance of CometChatMessageList using CometChatMessageListStyle.

Style Properties

Example: Custom Styling

Example: Custom Avatar Style

Example: Custom Mentions Style

Advanced

Message Templates

CometChatMessageTemplate is a pre-defined structure for creating message views that can be used as a starting point or blueprint for creating message bubbles.
Image

Date Separator Pattern

Customize the date separator pattern:
Image

Date Pattern

Customize the date pattern for message receipts:
Image

Props Reference

Message Header

Display user or group details in the header

Message Composer

Compose and send messages

Message Template

Customize message bubble templates

Theming

Learn how to customize the look and feel