> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-agent-in-group-react-v6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Message Bubble Styling

> Customize CometChat iOS UI Kit message bubbles with incoming and outgoing styles, borders, corner radius, and per-message-type styling.

<Accordion title="AI Integration Quick Reference">
  | Field             | Value                                                                                                                                                                                        |
  | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Platform          | iOS UI Kit                                                                                                                                                                                   |
  | Incoming Style    | `CometChatMessageBubble.style.incoming`                                                                                                                                                      |
  | Outgoing Style    | `CometChatMessageBubble.style.outgoing`                                                                                                                                                      |
  | Global Properties | `backgroundColor`, `borderWidth`, `borderColor`, `cornerRadius`                                                                                                                              |
  | Bubble Types      | `textBubbleStyle`, `imageBubbleStyle`, `videoBubbleStyle`, `audioBubbleStyle`, `fileBubbleStyle`, `pollBubbleStyle`, `linkPreviewBubbleStyle`, `deleteBubbleStyle`, `aiAssistantBubbleStyle` |
  | Action Bubble     | `CometChatMessageBubble.actionBubbleStyle`                                                                                                                                                   |
</Accordion>

## 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**

Both classes provide properties for customizing background color, border, corner radius, and specific styles for individual message types.

***

## Properties

### Global Styling (Static Variables)

| Property               | Description                                 |
| ---------------------- | ------------------------------------------- |
| **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       |

### Specific Message Type Styles

| Property                | Description                        |
| ----------------------- | ---------------------------------- |
| **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 to customize the incoming message bubble style:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize incoming message bubble appearance
    CometChatMessageBubble.style.incoming.backgroundColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.incoming.borderWidth = 2
    CometChatMessageBubble.style.incoming.borderColor = UIColor.black
    ```
  </Tab>
</Tabs>

### Customizing Outgoing Message Bubble

The following code snippet shows how to customize the outgoing message bubble style:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize outgoing message bubble appearance
    CometChatMessageBubble.style.outgoing.backgroundColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.outgoing.borderWidth = 2
    CometChatMessageBubble.style.outgoing.borderColor = UIColor.black
    ```
  </Tab>
</Tabs>

***

## Text Bubble

Text bubbles display plain text messages, which are the most common message type.

The following code snippet shows how to customize the text message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize text bubble for incoming messages
    CometChatMessageBubble.style.incoming.textBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")

    // Customize text bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.textBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/Kv5z_j0TcKGMfIHt/images/c6450e91-wMz744vX0SPYAAAAABJRU5ErkJggg.png?fit=max&auto=format&n=Kv5z_j0TcKGMfIHt&q=85&s=b5a584b352c8b97e531a2fd0e6a961ea" width="600" height="198" data-path="images/c6450e91-wMz744vX0SPYAAAAABJRU5ErkJggg.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/Esb0GoP81F5eUfZq/images/926a9be6-cG7iUgwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAtLNXwtikmSnAAAAAElFTkSuQmCC.png?fit=max&auto=format&n=Esb0GoP81F5eUfZq&q=85&s=f6914052c05b353ad083d3b8ef6875c7" width="600" height="198" data-path="images/926a9be6-cG7iUgwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAtLNXwtikmSnAAAAAElFTkSuQmCC.png" />
</Frame>

***

## Image Bubble

Image bubbles display messages with images.

The following code snippet shows how to customize the image message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize image bubble for incoming messages
    CometChatMessageBubble.style.incoming.imageBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")

    // Customize image bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.imageBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/dvwKpKGankGygs5o/images/6ab961bb-image_bubble_default-b8bf23f5b33c822970c4406e84033a28.png?fit=max&auto=format&n=dvwKpKGankGygs5o&q=85&s=f7ec58281ee4c909a824a46128266fcc" width="600" height="696" data-path="images/6ab961bb-image_bubble_default-b8bf23f5b33c822970c4406e84033a28.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/1UV7B-A4sFhTEtPO/images/0142ad15-image_bubble_style-ec93facaf1e770da88edab989870f404.png?fit=max&auto=format&n=1UV7B-A4sFhTEtPO&q=85&s=a125336e0c45fece3bf553a5fab20ce8" width="600" height="696" data-path="images/0142ad15-image_bubble_style-ec93facaf1e770da88edab989870f404.png" />
</Frame>

***

## Video Bubble

Video bubbles display messages with video clips.

The following code snippet shows how to customize the video message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize video bubble for incoming messages
    CometChatMessageBubble.style.incoming.videoBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")
    CometChatMessageBubble.style.incoming.videoBubbleStyle.playButtonTint = UIColor(hexString: "#F76808")

    // Customize video bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.deleteBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.outgoing.videoBubbleStyle.playButtonTint = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/ISrSQKUqQ1MtSM8O/images/2ddc55f3-video_bubble_default-802ce2f4539acfd1a9874646228aecc5.png?fit=max&auto=format&n=ISrSQKUqQ1MtSM8O&q=85&s=0b6c97fb504b63afd1ba5a3c9f6a316e" width="600" height="508" data-path="images/2ddc55f3-video_bubble_default-802ce2f4539acfd1a9874646228aecc5.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/iIeExfBhmmmkVYg_/images/5c1f63aa-video_bubble_style-17dcea3ad41de405d7ff1f44287c7310.png?fit=max&auto=format&n=iIeExfBhmmmkVYg_&q=85&s=311898964bafd19879a0c5df96bcffa2" width="600" height="508" data-path="images/5c1f63aa-video_bubble_style-17dcea3ad41de405d7ff1f44287c7310.png" />
</Frame>

***

## Audio Bubble

Audio bubbles display audio messages.

The following code snippet shows how to customize the audio message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize audio bubble for incoming messages
    CometChatMessageBubble.style.incoming.audioBubbleStyle.audioWaveFormTintColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.incoming.audioBubbleStyle.playImageTintColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.incoming.audioBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")

    // Customize audio bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.audioBubbleStyle.playImageTintColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.outgoing.audioBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/1dpm1fhJnD7O18Uv/images/ce95a207-audio_bubble_default-064a425c69bc5d1d6fc838e58832bd68.png?fit=max&auto=format&n=1dpm1fhJnD7O18Uv&q=85&s=dc37edfe47a04fb52bd0769923bad94e" width="600" height="320" data-path="images/ce95a207-audio_bubble_default-064a425c69bc5d1d6fc838e58832bd68.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/hvldi1e9uY_02hWX/images/89ee34eb-audio_bubble_style-0f06f06eb50d3c50004cabcf6b310a79.png?fit=max&auto=format&n=hvldi1e9uY_02hWX&q=85&s=36ae435e8aa53d74bb6670a2936d3d96" width="600" height="320" data-path="images/89ee34eb-audio_bubble_style-0f06f06eb50d3c50004cabcf6b310a79.png" />
</Frame>

***

## Poll Bubble

Poll bubbles display messages with polling options.

The following code snippet shows how to customize the poll message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize poll bubble for incoming messages
    CometChatMessageBubble.style.incoming.pollBubbleStyle.optionProgressTintColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.incoming.pollBubbleStyle.selectedPollImageTint = UIColor(hexString: "#F76808")
    CometChatMessageBubble.style.incoming.pollBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")

    // Customize poll bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.pollBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/8U2-5SWHI94obVDJ/images/9ca30347-poll_bubble_default-ed3d0e2eec56286b6b944df6d8b2c9fc.png?fit=max&auto=format&n=8U2-5SWHI94obVDJ&q=85&s=2f79d5004a3e2e5857a8b94861a150ac" width="600" height="706" data-path="images/9ca30347-poll_bubble_default-ed3d0e2eec56286b6b944df6d8b2c9fc.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/dvwKpKGankGygs5o/images/66eccf81-poll_bubble_style-f1d67fdb83c780340642b9e3b8181468.png?fit=max&auto=format&n=dvwKpKGankGygs5o&q=85&s=198bd716763ac344d5ba91f0ba4085ce" width="600" height="706" data-path="images/66eccf81-poll_bubble_style-f1d67fdb83c780340642b9e3b8181468.png" />
</Frame>

***

## Link Preview Bubble

The Link Preview Bubble displays 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 to customize the link preview message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize link preview bubble for incoming messages
    CometChatMessageBubble.style.incoming.linkPreviewBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")

    // Customize link preview bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.linkPreviewBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/8U2-5SWHI94obVDJ/images/9f0430e3-link_bubble_default-829d740912ff67a49ecef68209afa36a.png?fit=max&auto=format&n=8U2-5SWHI94obVDJ&q=85&s=4fd2a723a94fc7c8f346ddb7161c4ff5" width="600" height="918" data-path="images/9f0430e3-link_bubble_default-829d740912ff67a49ecef68209afa36a.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/wITpHRGFWGJvJnmU/images/ec04184e-link_bubble_style-3a858825ea1ff5ccfb52e17d9b92d676.png?fit=max&auto=format&n=wITpHRGFWGJvJnmU&q=85&s=0b0908a6c0a9c65efaf24e559f899ba2" width="600" height="918" data-path="images/ec04184e-link_bubble_style-3a858825ea1ff5ccfb52e17d9b92d676.png" />
</Frame>

***

## 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 to customize the action message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize action bubble appearance
    CometChatMessageBubble.actionBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")
    CometChatMessageBubble.actionBubbleStyle.bubbleTextColor = UIColor(hexString: "#F76808")
    CometChatMessageBubble.actionBubbleStyle.borderColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/dvwKpKGankGygs5o/images/691bff05-J0foAAAAASUVORK5CYII.png?fit=max&auto=format&n=dvwKpKGankGygs5o&q=85&s=dec26830c400040f4b374f7c531acdf4" width="600" height="238" data-path="images/691bff05-J0foAAAAASUVORK5CYII.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/gyYKxTizhi5zqoIK/images/58253a0a-QIdveaFpdAAAAAElFTkSuQmCC.png?fit=max&auto=format&n=gyYKxTizhi5zqoIK&q=85&s=dd213791623da3bb5ef9e8a564e4f052" width="600" height="238" data-path="images/58253a0a-QIdveaFpdAAAAAElFTkSuQmCC.png" />
</Frame>

***

## Delete Bubble

Delete bubbles display messages that have been deleted by the sender. These indicate the message removal within the chat interface.

The following code snippet shows how to customize the delete message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize delete bubble for incoming messages
    CometChatMessageBubble.style.incoming.deleteBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")

    // Customize delete bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.deleteBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

**Default**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/-aV5rjAnFmfmGI_M/images/856c509c-QEXxv1GpEWvXgAAAABJRU5ErkJggg.png?fit=max&auto=format&n=-aV5rjAnFmfmGI_M&q=85&s=ea495ce098788fb14092f13650c32630" width="600" height="198" data-path="images/856c509c-QEXxv1GpEWvXgAAAABJRU5ErkJggg.png" />
</Frame>

**Customization**

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b-docs-agent-in-group-react-v6/k82rLv-mRy38q-bk/images/e1714523-f767O9MAoLntcG84t3IpBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYP8PV4qoNg55LO0AAAAASUVORK5CYII.png?fit=max&auto=format&n=k82rLv-mRy38q-bk&q=85&s=864b3e352824c48ffc5d5d755a65d3c2" width="600" height="198" data-path="images/e1714523-f767O9MAoLntcG84t3IpBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYP8PV4qoNg55LO0AAAAASUVORK5CYII.png" />
</Frame>

***

## AI Assistant Bubble

The AI Assistant Bubble displays responses or messages sent by the AI assistant within the chat interface. These bubbles are designed to visually distinguish AI-generated messages from user messages, maintaining a clear and intuitive conversation flow.

You can customize the appearance of the AI Assistant message bubble to match your app's theme — including background color, text color, font, and border styling.

The following code snippet shows how to customize the AI Assistant message bubble:

<Tabs>
  <Tab title="Swift">
    ```swift lines theme={null}
    // Customize AI assistant bubble for incoming messages
    CometChatMessageBubble.style.incoming.aiAssistantBubbleStyle.backgroundColor = UIColor(hexString: "#FEEDE1")

    // Customize AI assistant bubble for outgoing messages
    CometChatMessageBubble.style.outgoing.aiAssistantBubbleStyle.backgroundColor = UIColor(hexString: "#F76808")
    ```
  </Tab>
</Tabs>

***

## Next Steps

<CardGroup cols={3}>
  <Card title="Message List" href="/ui-kit/ios/message-list">
    Display and customize the message list component
  </Card>

  <Card title="Message Composer" href="/ui-kit/ios/message-composer">
    Customize the message input component
  </Card>

  <Card title="Component Styling" href="/ui-kit/ios/component-styling">
    Learn about global styling options
  </Card>
</CardGroup>
