> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Styles

> How CometChat iOS UI Kit v6 styles work — SwiftUI style values and UIKit style objects, how they resolve against the theme, fonts, and the tokens they fall back to.

The UI Kit styles in two layers: the **theme**, which every component reads, and a
**component style**, which overrides the theme for one component. Each toolkit spells the
style in its own currency.

***

## Styling Approaches

> [tab] SwiftUI
>
> 1. **Theme** — `CometChatTheme` in the environment, set with `.cometChatTheme(_:)`.
> 2. **Component style** — a struct passed as `style:`, for example
>    `CometChatConversationsStyle`. Every property is optional.
>
> ```swift theme={null}
> var style = CometChatConversationsStyle()
> style.backgroundColor = Color(red: 0.96, green: 0.96, blue: 0.96)
> style.titleColor = Color(red: 0.41, green: 0.32, blue: 0.84)
> style.itemStyle = ConversationListItemStyle(
>     avatarStyle: AvatarStyle(backgroundColor: Color(red: 0.91, green: 0.88, blue: 1.0)),
>     badgeStyle: BadgeStyle(backgroundColor: .orange)
> )
>
> MyAppRoot()
>     .cometChatTheme(brandTheme)      // the theme, at the root
> CometChatConversations(style: style) // the style, on one screen
> ```

> [tab] UIKit
>
> 1. **Theme** — `CometChatUIKitTheme.shared`, or a screen's `theme`.
> 2. **Component style** — an `NSObject` class, for example
>    `ConversationsStyle`. Set it on one screen, or set the component's static
>    default before creating screens.
>
> ```swift theme={null}
> CometChatUIKitTheme.shared.setBrandColor(UIColor(red: 0.41, green: 0.32, blue: 0.84, alpha: 1))
>
> let style = ConversationsStyle()
> style.backgroundColor = UIColor(white: 0.96, alpha: 1)
> style.titleColor = UIColor(red: 0.41, green: 0.32, blue: 0.84, alpha: 1)
> conversations.set(style: style)
> ```
>
> Styles are `@objc`, so Objective-C apps set them too.

***

## How a style resolves

> [tab] SwiftUI
>
> ```
> style: argument  >  theme  >  Kit default
> ```
>
> When the view draws, the Kit builds a resolved style from it: every property you set is
> used, every `nil` is filled from the current theme and colour scheme. Nothing is frozen at
> construction, so switching appearance or theme restyles the unset parts.

> [tab] UIKit
>
> ```
> instance style  >  static default style  >  theme  >  Kit default
> ```
>
> A new screen copies the component's static style — `ConversationsStyle.style`,
> `CometChatMessageList.style`, `CometChatUsers.style` and so on. Unset colours and fonts are
> read from the screen's `theme` when it draws. A numeric property left at `-1` takes the
> Kit's default.
>
> ```swift theme={null}
> CometChatMessageList.style.messageBubbleStyle.outgoing.cornerRadius = 16   // every new list
> messageList.style.backgroundColor = .systemGroupedBackground               // this list only
> ```
>
> Assign a whole style to apply it at once; some screens read an in-place change only on
> their next restyle — call `refreshStyle()` where a screen offers it.

***

## Font Customization

> [tab] SwiftUI
>
> Set the family once on the theme:
>
> ```swift theme={null}
> var theme = CometChatTheme()
> theme.typography = .derived(family: "Avenir Next")
> ```
>
> Or one component's font through its style — a SwiftUI `Font`:
>
> ```swift theme={null}
> var style = CometChatConversationsStyle()
> style.titleFont = .custom("Avenir Next", size: 28, relativeTo: .largeTitle)
> CometChatConversations(style: style)
> ```

> [tab] UIKit
>
> Set a token once on the theme, or one component's font through its style — a `UIFont`:
>
> ```swift theme={null}
> CometChatUIKitTheme.shared.bodyRegular = UIFontMetrics(forTextStyle: .body)
>     .scaledFont(for: UIFont(name: "AvenirNext-Regular", size: 14) ?? .systemFont(ofSize: 14))
>
> let style = ConversationsStyle()
> style.itemTitleFont = .preferredFont(forTextStyle: .headline)
> conversations.set(style: style)
> ```

| Token family | Used for |
| - | - |
| `title…`, `heading1…` – `heading4…` | screen titles, names, section headings |
| `body…` | message text, list subtitles, input |
| `caption1…`, `caption2…` | dates, receipts, badges, helper text |
| `button…`, `link…` | buttons and links |

***

## Theme Color Tokens

A style property left unset falls back to one of these. Full values are on
[Color Resources](https://www.cometchat.com/docs/ui-kit/ios/v6/color-resources.md).

### Colors

| Token | Description |
| - | - |
| `primary` | brand colour for buttons, links, highlights |
| `background1` – `background4` | background levels |
| `textPrimary` / `textSecondary` / `textTertiary` | text colours |
| `textDisabled` / `textWhite` / `textHighlight` | special text colours |
| `error` / `success` / `warning` / `info` | alert colours |
| `strokeDefault` / `strokeLight` / `strokeDark` / `strokeHighlight` | border colours |

### Icon Tints

| Token | Description |
| - | - |
| `iconTintPrimary` / `iconTintSecondary` / `iconTintTertiary` | icon tints |
| `iconTintWhite` / `iconTintHighlight` | special icon tints |

### Button Colors

| Token | Description |
| - | - |
| `primaryButtonBackground` / `primaryButtonText` / `primaryButtonIconTint` | primary button |
| `secondaryButtonBackground` / `secondaryButtonText` / `secondaryButtonIconTint` | secondary button |

***

## Per-Component Style Properties

Key properties for the busiest components. Each component's page lists the rest.

### Conversations

> [tab] SwiftUI
>
> | `CometChatConversationsStyle` | Styles |
> | - | - |
> | `backgroundColor` | the screen |
> | `titleColor`, `titleFont` | the toolbar title |
> | `itemStyle` | the row: `ConversationListItemStyle` — name, subtitle, `dateStyle`, `badgeStyle`, `avatarStyle`, receipt |
> | `searchBackgroundColor`, `searchTextColor`, `searchPlaceholderColor` | accepted, but the search field is the system bar's and keeps its look |
> | `mentionTextColor`, `mentionBackgroundColor` | mentions in the last-message line |
> | `emptyStateStyle`, `errorStateStyle` | the state views |

> [tab] UIKit
>
> | `ConversationsStyle` | Styles |
> | - | - |
> | `backgroundColor` | the screen |
> | `titleColor`, `largeTitleColor` | the navigation title |
> | `itemTitleFont` | the row's name |
> | `tableViewSeparator` | the separator |

### Message List

> [tab] SwiftUI
>
> | `CometChatMessageListStyle` | Styles |
> | - | - |
> | `backgroundColor` | the list |
> | `incomingBubbleStyle`, `outgoingBubbleStyle`, `actionBubbleStyle` | the bubbles — see [Message Bubble Styling](https://www.cometchat.com/docs/ui-kit/ios/v6/message-bubble-styling.md) |
> | `dateSeparatorStyle`, `unreadSeparatorStyle` | the separators |
> | `reactionStyle`, `threadIndicatorStyle`, `newMessageIndicatorStyle` | reactions, "N replies", the new-message indicator |

> [tab] UIKit
>
> | `MessageListStyle` | Styles |
> | - | - |
> | `backgroundColor`, `borderColor`, `borderWidth`, `cornerRadius` | the list |
> | `messageBubbleStyle.incoming`, `.outgoing` | the bubbles |
> | `actionBubbleStyle`, `callActionBubbleStyle` | group actions and calls |
> | `dateSeparatorStyle`, `unreadSeparatorStyle`, `newMessageIndicatorStyle` | separators and the indicator |

### Message Composer

> [tab] SwiftUI
>
> | `CometChatMessageComposerStyle` | Styles |
> | - | - |
> | `composeBoxBackgroundColor`, `composeBoxStrokeColor`, `composeBoxCornerRadius` | the box around the input |
> | `inputTextColor`, `inputTextStyle`, `inputPlaceholderColor` | the input |
> | `attachmentIconTint`, `voiceRecordingIconTint`, `stickerIconTint` | the buttons |
> | `sendButtonActiveBackgroundColor`, `sendButtonInactiveBackgroundColor`, `sendButtonIconTint` | the send button |

> [tab] UIKit
>
> | `MessageComposerStyle` | Styles |
> | - | - |
> | `composeBoxBorderColor`, `composeBoxCornerRadius` | the box around the input |
> | `textFieldColor`, `placeholderColor` | the input |
> | `activeSendButtonBackgroundColor` | the send button |
> | `richTextToolbarStyle` | the formatting toolbar |

### Message Header

> [tab] SwiftUI
>
> | `CometChatMessageHeaderStyle` | Styles |
> | - | - |
> | `backgroundColor` | the bar, below iOS 26 |
> | `titleTextColor`, `titleTextStyle` | the name |
> | `subtitleTextColor`, `subtitleTextStyle` | presence or member count |
> | `avatarStyle` | the avatar |

> [tab] UIKit
>
> | `MessageHeaderStyle` | Styles |
> | - | - |
> | `backgroundColor`, `borderColor`, `borderWidth` | the bar |
> | `titleTextColor` | the name |
> | `backIconTint` | the back button |

***

## Related

* [Theme Introduction](https://www.cometchat.com/docs/ui-kit/ios/v6/theming.md) — global theming.
* [Component Styling](https://www.cometchat.com/docs/ui-kit/ios/v6/component-styling.md) — an example for every component.
* [Color Resources](https://www.cometchat.com/docs/ui-kit/ios/v6/color-resources.md) — the default palette.
* [Customization Overview](https://www.cometchat.com/docs/ui-kit/ios/v6/customization-overview.md) — every customization category.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.