Skip to main content
Configure and style the incoming, outgoing and per-kind bubbles of the message list.

Styling Architecture

Bubbles follow a hub-and-spoke pattern:
  1. Hub styles — one per side, incoming and outgoing, set the container: background, corner radius, border, the sender’s name, the time and the text.
  2. Per-kind styles — text, image, file, audio, poll and the rest — refine one kind’s content inside the hub.
The message list with incoming bubbles on the left and outgoing bubbles on the right
CometChatMessageListStyle has three hubs — incomingBubbleStyle, outgoingBubbleStyle and actionBubbleStyle (the centred group-action and call lines) — each a MessageBubbleStyle carrying a style per kind. Everything is optional: unset falls through to the theme.

Global Setup

Hub properties


Core Message Bubbles

The SwiftUI examples set a per-kind style on the outgoing hub; set it on incomingBubbleStyle for the other side.

Text Bubble

TextBubbleStyle also has textFont, codeTextColor, quoteBarColor, and separatorColor, the line between a translated message and its translation. Its linkPreviewStrokeColor and linkPreviewStrokeWidth change nothing: this toolkit draws no link preview.

Image and Video Bubbles

One bubble draws one or many attachments as a grid with “+N”.
Both also take placeholderColor, overflowScrimColor, overflowTextColor and overflowTextFont; video adds playBadgeBackground and the duration pill’s colours and font.

File Bubble

cardCornerLarge / cardCornerSmall shape the cards; expandColor / expandFont style “Show more”; downloadAll… the download-all button.

Audio Bubbles

audioBubbleStyle styles the voice note and a single audio file; audiosBubbleStyle the multi-file audio card.

Sticker Bubble

A sticker draws without a bubble, so it has no style of its own in either toolkit. Replace it with your own bubble factory (SwiftUI) or a custom / extension_sticker template (UIKit).

Poll Bubble

The voters’ avatars take avatarStyle; the radio buttons the …RadioButton… properties.

Collaborative Bubble

Documents and whiteboards.

Meet Call Bubble

Delete Bubble


List-Level Bubbles

Centred lines that belong to neither side.

Call Action Bubble

Action Bubble

Group actions — “Alice added Kabir”.

Separators and indicators

dateSeparatorStyle, unreadSeparatorStyle, newMessageIndicatorStyle, threadIndicatorStyle, reactionStyle and the reply quote’s incomingMessagePreviewStyle / outgoingMessagePreviewStyle sit on CometChatMessageListStyle.

Per-kind bubbles with templates

A bubble factory draws one kind. Register yours with bubbleFactories; it replaces the built-in for that kind. See Message List.

Next Steps

Component Styling

Style the other components.

Theme Introduction

Change the colours every bubble reads.