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

# Component Styling

> Style individual CometChat iOS UI Kit v6 components — lists, headers, the message list and composer, calls — with SwiftUI style values or UIKit style objects.

> [accordion] AI Integration Quick Reference
>
> ```json theme={null}
> {
>   "swiftUI": {
>     "pattern": "var style = CometChat<Component>Style(); style.<property> = …; CometChat<Component>(style: style)",
>     "kind": "struct, every property optional — unset falls through to the theme",
>     "module": "the style types are in CometChatSwiftUI"
>   },
>   "uiKit": {
>     "pattern": "let style = <Component>Style(); style.<property> = …; component.set(style: style) or component.style = style",
>     "global": "the component's static `style` (e.g. CometChatMessageList.style) is the default every instance created afterwards copies",
>     "kind": "NSObject class; unset colours and fonts follow CometChatUIKitTheme"
>   },
>   "related": ["/ui-kit/ios/v6/theming", "/ui-kit/ios/v6/color-resources", "/ui-kit/ios/v6/message-bubble-styling"]
> }
> ```

This page shows how to style one CometChat UI Kit component at a time, in both toolkits. To
change every component at once, set the [theme](https://www.cometchat.com/docs/ui-kit/ios/v6/theming.md) instead.

## When to use this

* One screen should look different from the rest of the Kit.
* You need to change a region the theme does not reach — a corner radius, a chip, a separator.
* You want a repeatable pattern that applies to every component.

## Prerequisites

* The UI Kit is installed and you are logged in.
* You know which toolkit you use: `CometChatSwiftUI` or `CometChatUIKit` (one per app).

## Styling Pattern

> [tab] SwiftUI
>
> Every component takes a `style:` argument — a struct named after the component. Every
> property is optional and resolved when the view draws, so a style carries only what you
> change and everything else follows the theme:
>
> ```swift theme={null}
> var style = CometChatConversationsStyle()
> style.titleColor = .purple
> style.itemStyle = ConversationListItemStyle(titleFont: .title3)
> CometChatConversations(style: style)
> ```
>
> Nested parts — a row, an avatar, a bubble — have styles of their own, set on the
> component's style.

> [tab] UIKit
>
> Every component has a style class. Assign one to a screen, or
> set the component's **static** style, which every instance created afterwards copies:
>
> ```swift theme={null}
> let style = ConversationsStyle()
> style.titleColor = .purple
> style.itemTitleFont = .preferredFont(forTextStyle: .headline)
> conversations.set(style: style)                 // this screen
>
> CometChatMessageList.style.backgroundColor = .systemGroupedBackground   // every new list
> ```
>
> Unset colours and fonts follow the screen's `theme`.

## Core concepts

* **Precedence.** SwiftUI: the `style:` argument, then the theme, then the Kit default. UIKit: the instance's style, then the component's static style, then the theme,
  then the Kit default.
* **Sparse styles.** A property you leave unset is never frozen: it reads the theme every time
  the component draws, so a later theme change still reaches it.
* **Liquid Glass.** On iOS 26 the Kit's navigation bars and the composer are Liquid Glass and
  belong to the system; their background properties apply on iOS 18–25, with Reduce
  Transparency on, or with `renderPath` set to `.fallback`.

***

## Implementation

### Chat Lists & Messaging

#### Conversations

![Conversations list styled through the theme and its style](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-brand.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=1e6677b15b1b69450e7fc98b553f2099)

What you're changing: the toolbar title and the row's name line.

> [tab] SwiftUI
>
> ```swift theme={null}
> CometChatConversations(
>     style: CometChatConversationsStyle(
>         titleColor: .purple,
>         itemStyle: ConversationListItemStyle(titleFont: .title3)
>     )
> )
> ```
>
> `itemStyle` is the row — name, subtitle, date, badge, avatar and receipt.

> [tab] UIKit
>
> ```swift theme={null}
> let style = ConversationsStyle()
> style.titleColor = .purple
> style.itemTitleFont = .preferredFont(forTextStyle: .headline)
> conversations.set(style: style)
> ```
>
> `ConversationsStyle.style` is the static default every new list copies.

#### Users

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatUsersStyle()
> style.stickyHeaderTextColor = .indigo
> style.itemStyle = UserListItemStyle(titleColor: .indigo, avatarStyle: .init(size: 48),
>                                     statusIndicatorColor: .mint)
> CometChatUsers(style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = UsersStyle()
> style.headerTitleColor = .secondaryLabel
> style.listItemTitleFont = .preferredFont(forTextStyle: .headline)
> style.listItemSelectedBackground = UIColor.systemTeal.withAlphaComponent(0.15)
> users.set(style: style)
>
> CometChatUsers.avatarStyle.cornerRadius = 8      // every new list
> ```

#### Groups

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatGroupsStyle()
> style.itemStyle = GroupListItemStyle(titleColor: .indigo, avatarStyle: .init(size: 48))
> style.retryButtonCornerRadius = 20
> CometChatGroups(style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = GroupsStyle()
> style.listItemTitleTextColor = .systemIndigo
> style.privateGroupImageBackgroundColor = .systemTeal
> let groups = CometChatGroups().set(style: style)
> ```

#### Message Header

![The message header with the user's avatar, name and presence](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/header-uikit-stock.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=e749787e3f6b504097b688c4de1c8d3f)

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatMessageHeaderStyle()
> style.titleTextColor = .indigo
> style.subtitleTextStyle = .footnote
> style.backIconTint = .indigo
> CometChatMessageHeader(user: user, style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = MessageHeaderStyle()
> style.titleTextColor = .systemIndigo
> style.backIconTint = .systemIndigo
> style.borderColor = .separator
> style.borderWidth = 0.5
> header.set(style: style)
> ```

#### Message List

The list's background, separators and bubbles. Per-kind bubble styles are on
[Message Bubble Styling](https://www.cometchat.com/docs/ui-kit/ios/v6/message-bubble-styling.md).

![The message list with incoming and outgoing bubbles](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-messageListMixed.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=d1afd10cac22a4e9d085b7e6ff226d42)

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatMessageListStyle()
> style.backgroundColor = Color(.systemGroupedBackground)
> style.outgoingBubbleStyle = MessageBubbleStyle(backgroundColor: .indigo, cornerRadius: 16)
> style.dateSeparatorStyle = DateSeparatorStyle(textColor: .secondary)
> CometChatMessageList(style: style, user: user)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = MessageListStyle()
> style.backgroundColor = .systemGroupedBackground
> style.messageBubbleStyle.outgoing.backgroundColor = .systemIndigo
> style.dateSeparatorStyle.textColor = .secondaryLabel
> messageList.style = style
> ```

#### Message Composer

![The message composer with its input box, attachment and send buttons](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-composerIdle.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=fa41617a44241e622fa9bbb6b1b72b46)

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatMessageComposerStyle()
> style.composeBoxCornerRadius = 20
> style.sendButtonActiveBackgroundColor = .indigo
> style.inputTextStyle = .preferredFont(forTextStyle: .callout)
> CometChatMessageComposer(user: user, style: style)
> ```
>
> The attachment menu, tray, tiles and mention list take their own style arguments —
> `attachmentPopupStyle`, `attachmentTrayStyle`, `attachmentTileStyle`,
> `suggestionListStyle`.

> [tab] UIKit
>
> ```swift theme={null}
> let style = MessageComposerStyle()
> style.composeBoxBorderColor = .separator
> style.placeholderColor = .tertiaryLabel
> style.richTextToolbarStyle.activeIconTintColor = .systemIndigo
> composer.set(style: style)
> ```
>
> Assign a style to apply it; changing a property of `composer.style` in place waits for the
> next theme change.

#### Group Members

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatGroupMembersStyle()
> style.itemTitleColor = .indigo
> style.scopeChipOwnerBackgroundColor = .orange
> style.avatarStyle = .init(size: 48)
> CometChatGroupMembers(group: group, style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = GroupMembersStyle()
> style.listItemTitleTextColor = .systemIndigo
> style.retryButtonCornerRadius = 20
> members.set(style: style)
> ```

#### Thread Header

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatThreadHeaderStyle()
> style.replyCountBackgroundColor = .yellow
> style.threadSubscriptionSelectedTintColor = .orange
> CometChatThreadHeader(parentMessage: parentMessage, style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = ThreadedMessageHeaderStyle()
> style.dividerTintColor = .systemYellow
> style.subscriptionSelectedTintColor = .systemOrange
> CometChatThreadHeader.style = style      // every new header
> ```

#### Mentions

How a mention reads in the conversation list's last-message line.

![The composer suggesting members to mention](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-composerMentions.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=8dca19cdd5ee3bf4db362adb10d93dd4)

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatConversationsStyle()
> style.mentionTextColor = .orange
> style.mentionBackgroundColor = .orange.opacity(0.15)
> CometChatConversations(style: style)
> ```

> [tab] UIKit
>
> The composer's mentions take a `MentionTextStyle`:
>
> ```swift theme={null}
> let mentions = MentionTextStyle()
> mentions.textColor = .systemIndigo
> mentions.loggedInUserTextColor = .systemOrange
> composer.mentionStyle = mentions
> ```

#### Search

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatSearchStyle()
> style.filterChipSelectedBackgroundColor = .purple.opacity(0.15)
> style.highlightTextColor = .purple
> CometChatSearch(style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = SearchStyle()
> style.filterChipSelectedBackgroundColor = .systemPurple.withAlphaComponent(0.15)
> style.highlightTextColor = .systemPurple
> CometChatSearch.style = style     // every screen created afterwards
> ```

#### Message Information

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatMessageInformationStyle()
> style.backgroundHighlightColor = .yellow
> style.itemNameTextColor = .indigo
> style.messageReceiptStyle = ReceiptStyle(readTint: .green)
> CometChatMessageInformation(message: sentMessage, style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = MessageInformationStyle()
> style.bubbleContainerBackgroundColor = .systemYellow
> style.listItemTitleTextColor = .systemIndigo
> info.style = style
> ```

#### Pinned and Saved Messages

> [tab] SwiftUI
>
> ```swift theme={null}
> var pinned = CometChatPinnedMessagesStyle()
> pinned.senderNameColor = .indigo
> CometChatPinnedMessages(user: user, style: pinned)
>
> var saved = CometChatSavedMessagesStyle()
> saved.unsaveActionBackgroundColor = .orange
> CometChatSavedMessages(style: saved)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> CometChatPinnedMessages.style.titleColor = .systemIndigo
> CometChatSavedMessages.style.unsaveActionBackgroundColor = .systemOrange
> ```

#### Reaction List

> [tab] SwiftUI
>
> ```swift theme={null}
> struct StyledReactionList: View {
>     let message: BaseMessage
>     var body: some View {
>         var style = CometChatReactionListStyle()
>         style.tabActiveIndicatorColor = .orange
>         style.itemStyle = CometChatReactionListItemStyle(titleTextColor: .indigo)
>         return CometChatReactionList(baseMessage: message, style: style)
>     }
> }
> ```

> [tab] UIKit
>
> ```swift theme={null}
> CometChatReactionList.style.reactionActiveTabTextColor = .systemIndigo
> CometChatReactionList.avatarStyle.backgroundColor = .systemTeal
> ```

### Calling UI

#### Call Buttons

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatCallButtonsStyle()
> style.voiceCallButtonStyle = CallButtonStyle(iconTint: .green, backgroundColor: .green.opacity(0.12),
>                                              cornerRadius: 20, buttonPadding: 8)
> style.marginBetweenButtons = 16
> CometChatCallButtons(style: style, user: user, onCallInitiated: { presentMyCallScreen(for: $0) })
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = CallButtonStyle()
> style.voiceCallButtonStyle.iconTint = .systemGreen
> style.voiceCallButtonStyle.cornerRadius = 20
> style.marginBetweenButtons = 16
> buttons.set(style: style)
> ```

#### Call Logs

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatCallLogsStyle()
> style.backgroundColor = Color(.systemGroupedBackground)
> style.emptyStateTitleColor = .indigo
> CometChatCallLogs(style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let style = CallLogStyle()
> style.listItemTitleTextColor = .systemIndigo
> style.listItemSubTitleFont = .preferredFont(forTextStyle: .footnote)
> CometChatCallLogs.style = style      // every new call log
> ```

#### Outgoing Call

> [tab] SwiftUI
>
> ```swift theme={null}
> var style = CometChatOutgoingCallStyle()
> style.titleColor = .white
> style.backgroundColor = .indigo
> style.endCallButtonBackgroundColor = .red
> CometChatOutgoingCall(call: themeDocsCall, style: style)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> CometChatOutgoingCall.style.backgroundColor = .systemIndigo
> CometChatOutgoingCall.style.nameTextColor = .white
> ```

> [!NOTE]
>
> The Kit has no incoming-call screen of its own in v6 yet, so there is no incoming-call style.

### Base Components

#### Avatar

> [tab] SwiftUI
>
> `AvatarStyle` — `size`, `backgroundColor`, `textColor`, `font` — is set wherever an avatar
> appears: a row's `itemStyle.avatarStyle`, the header's `avatarStyle`:
>
> ```swift theme={null}
> var style = CometChatMessageHeaderStyle()
> style.avatarStyle = AvatarStyle(size: 36, backgroundColor: .orange, textColor: .white)
> CometChatMessageHeader(user: user, style: style)
> ```

> [tab] UIKit
>
> `CometChatAvatar.style` is the default for every avatar created afterwards; lists also
> carry their own:
>
> ```swift theme={null}
> CometChatAvatar.style.backgroundColor = .systemOrange
> CometChatAvatar.style.cornerRadius = 8
> CometChatUsers.avatarStyle.cornerRadius = 8
> ```

#### Badge and Status Indicator

> [tab] SwiftUI
>
> `BadgeStyle` styles the unread count and `StatusIndicatorStyle` the presence dot, through
> the row's style:
>
> ```swift theme={null}
> CometChatConversations(
>     style: CometChatConversationsStyle(
>         itemStyle: ConversationListItemStyle(badgeStyle: BadgeStyle(backgroundColor: .orange))
>     )
> )
> ```

> [tab] UIKit
>
> ```swift theme={null}
> CometChatUsers.statusIndicatorStyle.backgroundColor = .systemMint
> ```

***

## Customization matrix

| Need | SwiftUI | UIKit |
| - | - | - |
| Brand colour everywhere | `.cometChatTheme(_:)` at the root | `CometChatUIKitTheme.shared.setBrandColor(_:)` |
| One screen looks different | `style:` argument | `set(style:)` or `style` on the instance |
| Every instance of a component | one style value you pass to each instance | the component's static `style` |
| One region of a row | a [view slot](https://www.cometchat.com/docs/ui-kit/ios/v6/customization-view-slots.md) | a view slot, or a cell subclass |
| A message kind's bubble | the bubble's style on `MessageBubbleStyle` | a [template](https://www.cometchat.com/docs/ui-kit/ios/v6/message-bubble-styling.md) |

## Next Steps

> [card] [Message Bubble Styling](https://www.cometchat.com/docs/ui-kit/ios/v6/message-bubble-styling.md)
>
> Incoming, outgoing and per-kind bubbles.

> [card] [Styles](https://www.cometchat.com/docs/ui-kit/ios/v6/customization-styles.md)
>
> How style resolution works in each toolkit.


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