Skip to main content
CometChatMessageList is the scrolling conversation between the header and the composer. It fetches a chat’s messages, pages back through history, stays live, and draws every message kind as a bubble: text, images and videos, files, audio and voice notes, stickers, polls, meetings, collaborative documents, cards and AI replies.
CometChatMessageList showing a group conversation with incoming and outgoing messages, a thread reply count and a missed-call entry

Where It Fits

Place it between the message header and the message composer, and give it the chat’s User or Group — and a parent message for a thread.
It fetches the latest page itself and listens to the SDK and the Kit’s event bus, so what the composer sends appears at once. Its Edit and Reply options reach the composer through the bus — no wiring. State lives in a MessageListStore, shared by both toolkits.

Quick Start

The list fills the screen, and the header and the composer are bars over it. The rows scroll under their Liquid Glass on iOS 26 and still come to rest clear of them. Host the bars with safeAreaBar on iOS 26: it also carries the list’s scroll edge effect under each bar, so the rows fade softly behind it. Earlier versions have no edge effect, and safeAreaInset hosts the bars the same way. Stacked in a VStack instead, nothing passes under the bars and the glass has nothing to show.
The SwiftUI message list: an incoming image with reactions, an outgoing reply quoting it with 3 Replies under it, a missed call, the New separator, an edited and a deleted message, a pinned message and a failed send
Conversation List + Message View builds the whole chat screen this way. A group works the same way. For a thread, pass the thread’s root message:
parentMessageId still works but is deprecated: it is read only when parentMessage is nil. Pass the message, so replies arriving live carry its thread subscription state.
With autoFetch: false the list takes the chat but fetches nothing. user wins when both user and group are given, but the chat still counts as a group for avatars and names.

Filtering Messages

The list’s default request fetches only the Kit’s own message types. A request builder replaces it whole: the list adds the user or group, so set the types, categories, page size, hideReplies and — for a thread — the parent message id yourself.
Pass messagesRequestBuilder, a closure that returns the builder. Live messages are filtered by the same types.
A custom message type needs its own entry in the builder’s types. Your Own Bubble shows a complete example.

What the List Shows

The list opens at the newest message. Scrolling to the top loads the older page, with a spinner above the first row; after a jump, scrolling to the bottom loads newer messages the same way.
A failed older page replaces the rows with the error view — even when messages were already showing — and calls onError. With hideErrorState the list shows nothing until a retry.

Separators and the Sticky Date

A date separator heads each day: “Today”, “Yesterday”, then a date. While the list scrolls, the top row’s day stays pinned as a sticky date. With startFromUnreadMessages: true the list opens at the first unread message, marked by a new-messages separator.
The message list spanning several days: date separators reading June 3, 2026, June 12, 2026, Yesterday and Today above each day's messages

New Messages and the Indicator

At the bottom, the list follows new messages. Scrolled up, it stays where it is and shows the new-message indicator — an arrow with a count, “999+” at most. A tap scrolls to the newest message; when newer pages are not loaded yet, it fetches the latest page first.
scrollToBottomOnNewMessage: false does not stop a list that is already at the bottom from following new messages: within five rows of the end, it always scrolls.
Reaching the bottom marks the newest message read and clears the unread count. disableReceipt: true sends no delivery or read receipts.

Jumping to a Message

goToMessageId scrolls to a message and highlights it — from a search result, say. It is a binding: the list sets it back to nil when the jump lands, so the same id can be sent again.
A message that is not loaded is fetched with its neighbours. Tapping a reply’s quote jumps the same way.

Rows

Your messages sit on the trailing side, everyone else’s on the leading side, and group actions and calls are centred. messageAlignment: .leftAligned draws every message on the leading side, as incoming.An incoming row shows the sender’s avatar and name in a group — never in a one-to-one chat, except the avatar in a chat with an AI agent. hideAvatar: true removes the avatar.The status line under a bubble holds, in order: a pin and a bookmark when the message is pinned or saved, “edited”, the time, and on your own messages the receipt — a clock while sending, then sent, delivered and read, or an error when the send failed. There is no retry. timeStampAlignment: .top moves the time up beside the sender’s name.
hideReceipts has no effect: receipts stay. Replace the status line with a row slot to remove them.
Consecutive messages from one sender are not grouped: each has its own avatar, name and status line. The one grouping is a batch: with enableMultipleAttachments on — the default — attachments sent together draw as a group, the avatar on the first and the receipt on the last.

Bubbles

Every message kind is drawn by a built-in bubble.
Each kind is drawn by a bubble factory. The built-ins:A deleted message of any kind draws the tombstone, “This message was deleted”, and a kind nothing draws shows “Unsupported: category_type” — never a blank row. The unsupported text is English in every language.enableMultipleAttachments: false switches image, video, file and audio messages to the older single-attachment bubbles, and stops batch grouping.

Your Own Bubble

A factory names a MessageKind and draws its content. Register it with bubbleFactories; it replaces any built-in for the same kind, and the last one registered wins. Ask the request builder for your type too (see Filtering Messages):
A factory draws only what it returns. Every other region — avatar, name, quote, status line, moderation notice, reactions, “N replies” — keeps the list’s default. A factory can return any of them too, or bubbleView to replace the whole row:Keep a built-in’s content and change one region by delegating to it:
  • A deleted message always draws the built-in tombstone. No factory can replace it.
  • Registering a factory for .groupAction, .audioCall or .videoCall gives those centred rows the full chrome — name, status line and reactions.

Bubble Taps

To take over a tap, register the built-in factory with its callback — it replaces the default for that kind:
Join joins the meeting through the Kit’s call coordinator and shows the ongoing-call screen, reading the session id from the message. To handle it yourself, use MeetingBubbleFactory(onJoinClick:), or for every list in a subtree .cometChatMeetingJoinClick(MessageMeetingJoinAction { message, sessionID in … }). The session id onJoinClick receives is empty for meetings the Kit sent; read it from the message instead.

Reactions

Reactions show under the bubble: up to four chips, then a “+N” chip for the rest, and an add button. A chip shows its count, and is highlighted when you reacted with it. Tapping a chip toggles your reaction — onReactionClick replaces that. The row changes only when the server confirms.
Messages with reaction chips and an add-reaction button under the bubbles, the chips the user reacted with highlighted
The add button, “+N”, and the add-reaction button in the long-press menu open the emoji keyboard in a 400 pt sheet. Picking an emoji adds it — one you have already reacted with is sent again, not removed — and closes the sheet. From the menu, the menu closes first and the sheet rises after it.
  • onAddMoreReactionsClick replaces the sheet for “+N” and the add button.
  • onEmojiPickerClick replaces it for the menu’s button. It is called while the menu is still on screen, with the message.
Long-pressing a chip opens the reaction list in a half-height sheet with a grabber: who reacted, under a tab per emoji, opened on All. Tapping your own row removes your reaction; the sheet closes when the last one is gone.
  • onReactionLongClick replaces the sheet.
  • reactionsRequestBuilder and reactionListStyle reach the sheet — or style it from above the list with .cometChatMessageListReactionListStyle(_:); the parameter wins when set.
hideReactions: true removes the chips. A footerView slot still shows.

Replies and Threads

A reply carries a quote of the message it answers. Tapping the quote jumps to that message. Swiping a row toward the trailing edge replies to it, as the Reply option does — swipeToReplyEnabled: false turns that off. There is no swipe on actions, calls, AI replies, unsent or deleted messages, or in a chat with an AI agent.A message with replies shows “N replies” under it. Tapping it, or choosing Reply in thread, calls onThreadRepliesClick with the thread’s root. Show the thread in its own list, with the thread header and the composer as bars over it — ChatBars from Quick Start:
In a thread there is no Reply in thread and no Mark as unread.

Thread Subscription

The Subscribe to thread option subscribes you to a message’s thread, and turns into Unsubscribe from thread once you are. It needs thread subscriptions on for your app. hideThreadSubscriptionOption removes it.
The result shows as a toast:On a message with no replies yet the two success toasts are shorter. A subscription changed elsewhere — another list, another device — updates the option.

Pin and Save

Pin, Unpin, Save and Unsave appear only when your app has the pin or save feature turned on. Pin and Save act at once; Unpin and Unsave ask first, in an alert that a tap outside does not dismiss. A toast says how it went.
The toast reads “Message pinned”, “Message saved”…, the app’s limit — “You can only pin 3 messages. Unpin one to pin another.” — a missing permission, or a generic failure.
Pinned and saved messages: a pin, a bookmark or both before the time on each status line
The row changes when the server’s update arrives, not when you tap. A pinned or saved message shows a pin or a bookmark before its time. There is no per-list flag for these options: they follow your app’s settings. The pinned and saved lists belong to other screens.

AI

Conversation Starters, Smart Replies and Summary

Three optional panels, each off by default:
Smart replies over the bottom of the list: a Smart Replies title, a close button and three suggested replies
Smart replies are fetched smartRepliesDelayDuration milliseconds (10 000 by default) after an incoming text, and only for a text containing one of smartRepliesKeywords when you set any. A tap on a starter or a smart reply puts its text in the composer, through the .composeMessage UI event; onConversationStarterClick and onSmartReplyClick replace that. Each panel has a style and a view slot — conversationStarterView, smartRepliesView, conversationSummaryView — that receives its state:
The panels need the matching AI features enabled for your app. They are off in a chat with an AI agent, and only the main list — not a thread — fetches them.

Chats With an AI Agent

A user whose role is @agentic is an AI agent.
In a chat with one:
  • the empty chat shows the agent’s greeting, introduction and suggested messages from its metadata; a tap on a suggestion puts it in the composer;
  • the agent’s reply streams in — a thinking shimmer, then text as it arrives, then the finished reply with markdown and cards; a broken stream shows an error;
  • there is no long press, no swipe to reply and no reactions;
  • the list does not page back; loadLastAgentConversation: true opens the latest conversation with the agent instead of the greeting.
An empty chat with an AI agent named Nova: its avatar, the greeting Hi, I'm Nova, an introduction and four suggested-message chips
hideAiAssistantSuggestedMessages has no effect: the suggestions always show.

Message Information

Info, on your own messages, opens message information in a sheet with a medium and a large detent.
The sheet shows the message as a bubble, then who it reached and who read it. It gets the list’s bubbleFactories, onError and its style’s messageInformationStyle; onMessageOptionClick still fires. hideMessageInfoOption removes the option.
The sheet formats mentions itself, so the list hands it no text formatters.

Report

Report, on someone else’s message, presents the flag message dialog full screen over the chat, opening and closing without animation. The dialog fetches the app’s flag reasons; the list flags the message when Report is tapped, closes the dialog on success and shows its error line on failure. A tap on the scrim closes it.
The dialog sits over a 40 % scrim, a Liquid Glass card on iOS 26. onMessageOptionClick still fires; hideFlagOption removes the option and hideFlagRemarkInputField the dialog’s remark field. The list passes no style or texts — style the dialog with the theme and the cometChatFlagMessage… slot modifiers, which reach it:

Actions and Events

Callback Methods

onLoad, onEmpty and onError are called every time the view renders while their state holds, not once. Keep them idempotent. onError does not hear a failed delete, reaction or translation.
“Message privately” does nothing without onMessagePrivately: the sender is fetched and dropped.

Global Events

The list emits:See Events for the whole bus.

SDK Events (Real-Time, Automatic)

No wiring required — the list listens to the SDK and to the Kit’s message, group and call events for its chat, and updates itself.

Functionality

Visibility:The same elements can be hidden for a whole subtree — it can hide more than a list’s own flags, never less. .newMessageIndicator has no parameter:

Custom View Slots

Row Slots

Every region of every row can be replaced. Each slot is a MessageRowSlot — (ChatMessage, MessageAlignment) -> AnyView:A slot outranks a factory’s region, which outranks the list’s default.
Every slot is also a modifier, for every list in a subtree. An initialiser argument wins:
With messageAlignment: .leftAligned, a slot is told the sender’s alignment — .outgoing for your own messages — although the row is drawn on the leading side.

State and List Views

The header and footer do not scroll with the messages. Each slot has a modifier too — .cometChatMessageListEmptyView { … } and so on.

Formatting

Mentions

A tap on a user mention in a text message opens that user’s chat: the list raises the openChat UI event with that user. Push the chat where your app navigates:
A TextBubbleFactory(onMentionClick:) you register still gets the tap, first. Mention-all opens nothing.Mentions are drawn by a mentions formatter. With textFormatters: nil, the default, the list makes one — disableMentionAll turns off mention-all, and mentionAllLabelId with mentionAllLabel rename it:
Copy and Share put out the raw text — a mention stays <@uid:…> — unless you pass textFormatters.

A long press on a message opens its menu: a bar of quick reactions and the options. Up to six options show at once; with more, a seventh row, More, expands the rest in place — it stays as the header of the same card, and tapping it again folds them back.
The quick-reactions bar sits above the message, and the options below it.
The option menu over a long-pressed incoming text: a bar of six quick reactions above it, and below it Reply, Reply In Thread, Subscribe to thread, Copy, Share, Translate and More
There is no long press on group actions, calls, or an AI agent’s replies, nor on a message that is still sending or was deleted. In a chat with an AI agent there is none at all.
Each option keeps its rules:A message the moderator disapproved keeps only Copy, Delete and Translate, and has no quick reactions.
Delete asks first, in a system alert. The row changes only when the server confirms; a failed delete changes nothing and reports nothing. Translate draws the translation under the message’s text, below a separator, with a “Translated message” caption.
Every chosen option ends at onMessageOptionClick, after the built-in handling, with the option’s id and title:

Hiding Options

Each built-in has a flag: hideReplyOption, hideReplyInThreadOption, hideThreadSubscriptionOption, hideCopyMessageOption, hideEditMessageOption, hideDeleteMessageOption, hideShareMessageOption, hideTranslateMessageOption, hideMarkAsUnreadOption, hideMessageInfoOption, hideFlagOption (Report), hideMessagePrivatelyOption, and hideMessageReactionOption (the quick reactions).
hideReplyOption also hides an option of yours with the id reply_to_message. hideFlagRemarkInputField hides the report dialog’s remark field.

Your Own Options

addOptions appends options after the built-ins. options replaces the menu when it returns non-nil, and then addOptions is not asked. Neither is filtered by the hide flags. An option with its own onClick runs that instead of the list’s handling, and does not reach onMessageOptionClick:
To change who may edit, delete, report, see Info or message privately, pass an optionsPolicy:

Quick Reactions

The bar shows quickReactions — 👍 ❤️ 😂 😮 😢 🙏 by default. A tap adds that reaction; onQuickReactionClick replaces that. Tapping a reaction you already gave adds it again rather than removing it. An empty list shows the popup’s own five.

Advanced Methods

Store Access

Every list has a MessageListStore. Pass your own to share it, or to render fixed state with no session — a seeded store fetches, listens and sends nothing:
MessageListPolicy holds the list’s rules:
The behaviour flags — disableReceipt, startFromUnreadMessages, unreadMessageThreshold, the sound flags, the AI flags and loadLastAgentConversation — reach the store only when the user, group or goToMessageId changes. Changing one on a list already showing that chat has no effect.

Subclassing

CometChatMessageList is a View struct. Customise it with its parameters, slots, modifiers, store and policies.

Objective-C

In the UIKit toolkit: The list is @objc. Fluent setters take Swift’s set(user:) as setWithUser::
CometChatMessageTemplate is a class, so Objective-C can build one. Swift only: store / set(store:), quickReactions, dateTimeFormatter, set(textFormatters:), the three pattern setters, and the four state-copy properties (emptyTitleText, emptySubtitleText, errorTitleText, errorSubtitleText).

Style

CometChatMessageListStyle is sparse: set only what you change, and everything else follows the theme.
Each MessageBubbleStyle also carries a content style per kind: textBubbleStyle, imageBubbleStyle, videoBubbleStyle, fileBubbleStyle, audioBubbleStyle (the voice note), audiosBubbleStyle, meetCallBubbleStyle, pollBubbleStyle, collaborativeBubbleStyle, deleteBubbleStyle and, on actionBubbleStyle, callActionBubbleStyle. A factory’s own style(for:) wins over the list’s.
aiAssistantBubbleStyle and moderationViewStyle exist but are not applied: AI replies take the incoming style, and the moderation notice its fixed colours.
For every list — and every other component — set the theme at the root:

Next Steps

Message Composer

The input the list’s Edit, Reply and smart replies fill

Message Header

The bar above the list

Events

What the list listens to and announces

Theming

The tokens every bubble’s default comes from