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

# Text Bubble

> Text Bubble — CometChat documentation.

`CometChatTextBubble` is the content view shown for TextMessage.

| Methods                       | Type            | Description                                 |
| ----------------------------- | --------------- | ------------------------------------------- |
| `set(text: String)`           | String          | the text to display                         |
| `set(style: TextBubbleStyle)` | TextBubbleStyle | used to customize appearance of this bubble |

## TextBubbleStyle

`TextBubbleStyle` is the class containing attributes to customize appearance of this widget.

| Methods                                   | Type                 | Description                                  |
| ----------------------------------------- | -------------------- | -------------------------------------------- |
| `set(titleFont: UIFont)`                  | UIFont               | used to set font of the text of the message  |
| `set(titleColor: UIColor)`                | UIColor              | used to set color of the text of the message |
| `set(background: UIColor)`                | UIColor              | used to set background color                 |
| `set(borderColor: UIColor)`               | UIColor              | used to set a border color                   |
| `set(borderWidth: CGFloat)`               | CGFloat              | used to set border                           |
| `set(cornerRadius: CometChatCornerStyle)` | CometChatCornerStyle | used to set border radius                    |

## Usage

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    //create text bubble style object
      let textBubbleStyle = TextBubbleStyle()

    //modify the style properties
     textBubbleStyle.set(titleColor: .black)
            textBubbleStyle.set(titleFont: UIFont.systemFont(ofSize: 12.0))
            textBubbleStyle.set(background: .blue)
            textBubbleStyle.set(borderColor: .blue)
            textBubbleStyle.set(borderWidth: 2.0)
            textBubbleStyle.set(cornerRadius: CometChatCornerStyle(cornerRadius: 5.0))

    //set style to the text bubble object
     textBubble.set(style: textBubbleStyle)
    ```
  </Tab>
</Tabs>
