Overview
The MessageBubble styling API allows developers to customize the appearance of incoming and outgoing message bubbles globally or at the component level. This includes various message types such as text, image, video, audio, file, and document bubbles. There are two primary classes for styling message bubbles:- CometChat Incoming Message Bubble Style
- CometChat Outgoing Message Bubble Style
Properties
Global Styling (Static Variables)- backgroundColor: The background color for message bubbles.
- backgroundDrawable: A background image for message bubbles.
- borderWidth: The width of the border for message bubbles.
- borderColor: The color of the border for message bubbles.
- cornerRadius: The corner radius for message bubbles.
- textBubbleStyle: Style for text message bubbles.
- imageBubbleStyle: Style for image message bubbles.
- videoBubbleStyle: Style for video message bubbles.
- audioBubbleStyle: Style for audio message bubbles.
- fileBubbleStyle: Style for file message bubbles.
- documentBubbleStyle: Style for document message bubbles.
Customization Examples
Customizing Incoming Message Bubble
The following code snippet shows how customize the incoming message bubble style:Customizing Outgoing Message Bubble
The following code snippet shows how customize the outgoing message bubble style:Text Bubble
Text bubbles display plain text messages, which are the most common message type. The following code snippet shows how customize the text message bubble:

Image Bubble
Image bubbles display messages with images. The following code snippet shows how customize the Image message bubble:

Video Bubble
Video bubbles display messages with video clips. The following code snippet shows how customize the Video message bubble:

Audio Bubble
Audio bubbles display Audio messages. The following code snippet shows how customize the Audio message bubble:

Poll Bubble
Poll bubbles display messages with polling. The following code snippet shows how customize the Poll message bubble:

Link Preview Bubble
The Link Preview Bubble is designed to display a preview of links shared in messages. It enriches the messaging experience by showing details such as the page title, description, and an image from the linked content, making links more engaging and informative. The following code snippet shows how customize the Link preview message bubble:

Action Bubble
Action bubbles provide a customizable interface for displaying a variety of actions, such as group actions, within a chat. The following code snippet shows how customize the action message bubble:

Delete Bubble
Delete bubbles displays messages that have been deleted by the sender. These indicate the message removal within the chat interface. The following code snippet shows how customize the delete message bubble:
