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

# Message Header

> The bar at the top of a chat: name, avatar, presence, typing, member count, AI and call buttons, and a menu.

`CometChatMessageHeader` is the bar at the top of a conversation. It shows who you are
talking to — a user or a group — with their avatar, and a subtitle that stays live: online,
last seen, typing, or a group's member count.

It looks like a standard iOS app's header. There's no full-width strip: three separate
elements float over the message list, and the list scrolls under them.

```
[ ‹ ]  [ (avatar●) Name            ]  [ 📹  📞  ⋯ ]
        status / last seen / typing
```

* **Back circle:** a 44pt circle holding the back chevron.
* **Identity pill:** a capsule that takes the remaining width, with the avatar (and a
  group's badge), the name, and the subtitle.
* **Trailing pill:** the call buttons, then new chat and chat history, then the `⋯` menu,
  then your trailing view. Each button is 44pt wide; a pill with one button is a 44pt
  circle. With nothing to show, the pill isn't drawn and the identity pill takes the space.

On iOS 26 each element is Liquid Glass. On iOS 18–25, and with Reduce Transparency on, the
same elements are filled with the theme's `background1` and outlined with a one-pixel
`strokeLight` edge. The whole layout mirrors in a right-to-left language, and the identity
pill grows with Dynamic Type instead of clipping.

![CometChatMessageHeader showing a user's avatar, name and online status with a back button](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-overview-message-header.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=1a9e771076bd6ac188bd29ad29916ba7)

***

## Where It Fits

> [tab] SwiftUI
>
> ```
> CometChatConversations / CometChatUsers
>         │ onItemClick
>         ▼
> ┌───────────────────────────────┐
> │ CometChatMessageHeader  ← here │
> │ message list                   │
> │ composer                       │
> └───────────────────────────────┘
> ```
>
> Give it the chat's `User` or `Group`. It fetches nothing to start, so it renders at once,
> then keeps itself current from the SDK and the Kit's event bus.

> [tab] UIKit
>
> Place it at the top of your chat view controller, above the message list and composer.
> Give it the chat's `User` or `Group`; it renders at once and keeps itself current.

***

## Quick Start

> [tab] SwiftUI
>
> ```swift theme={null}
> struct ChatScreen: View {
>     let user: CometChatSDK.User
>     @Environment(\.dismiss) private var dismiss
>
>     var body: some View {
>         VStack(spacing: 0) {
>             CometChatMessageHeader(user: user, onBack: { dismiss() })
>             Spacer()
>         }
>     }
> }
> ```
>
> In a chat, host the header as a bar over the message list, as [Conversation List + Message View](https://www.cometchat.com/docs/ui-kit/ios/v6/conversation-message-view.md#step-2-set-up-the-message-screen) shows.
>
> A group works the same way — `CometChatMessageHeader(group: group)`.
>
> ![A group header: the back circle, the identity pill with the avatar and its private-group badge, Team Leads over 12 Members, and the new-chat button in the trailing pill](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/header-override-none.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=3a1895b015d8cdb0518d76c9a7ba3ae6)

> [tab] UIKit
>
> `CometChatMessageHeader` is a `UIView`, and is Objective-C compatible.
>
> ```swift theme={null}
> final class ChatViewController: UIViewController {
>     private let header = CometChatMessageHeader()
>     var user: CometChatSDK.User!
>
>     override func viewDidLoad() {
>         super.viewDidLoad()
>         header.set(user: user)
>         header.hideBackButton = false
>         header.set(onBack: { [weak self] in self?.navigationController?.popViewController(animated: true) })
>
>         header.translatesAutoresizingMaskIntoConstraints = false
>         view.addSubview(header)
>         NSLayoutConstraint.activate([
>             header.leadingAnchor.constraint(equalTo: view.leadingAnchor),
>             header.trailingAnchor.constraint(equalTo: view.trailingAnchor),
>             header.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
>         ])
>     }
> }
> ```
>
> Give the header its width and top; its height is its own (60pt at the default text size).
>
> ![The UIKit header with the back button shown, avatar, name and Offline](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/header-uikit-backShown.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=23e862852472e9812e638b623c8a9ea5)

> [!NOTE]
>
> Back calls `onBack` and nothing else. The header never dismisses or pops by itself — your
> navigation decides what "back" means.

***

## What the Subtitle Says

One line, decided in this order:

| When | Subtitle |
| - | - |
| someone is typing | "Typing…" in a chat; "Alice is typing…" in a group — the latest typist |
| the user is an AI agent | "AI Assistant" |
| either side has blocked the other, or `hideUserStatus` | nothing |
| the user is online | "Online" |
| the user has a last-active time | "Last seen …", worded as below |
| no last-active time | "Offline" |
| a group | "12 Members"; one, zero or an unknown count reads "1 Member" / "0 Member" |

The typing line clears one second after the typist stops.

> [tab] SwiftUI
>
> With the name hidden by a blocked user or `hideUserStatus`, the name centres. The last-seen
> text reads "Last seen 17 minutes ago", "Last seen 2 hours ago", "Last seen 3 days ago" or
> "Last seen Just now".

> [tab] UIKit
>
> The last-seen text reads "Last seen 1 min ago", "Last seen 17 mins ago", "Last seen 3 hrs
> ago", then "Last seen 15 Jun at 02:30 PM" — with the year when it differs.

### Your own "Last seen" text

> [tab] SwiftUI
>
> `lastSeenTextFormatter` replaces the whole line for an offline user:
>
> ```swift theme={null}
> CometChatMessageHeader(
>     user: user,
>     lastSeenTextFormatter: { user in
>         user.lastActiveAt.map { "Away since \($0.formatted(date: .omitted, time: .shortened))" } ?? "Away"
>     }
> )
> ```
>
> `dateTimeFormatter` is the Kit-wide nine-bucket formatter. The SwiftUI header asks it for
> `otherDays` only, and puts "Last seen" in front of its answer.

> [tab] UIKit
>
> `dateTimeFormatter` is asked bucket by bucket — minute, minutes, hour, hours, today,
> yesterday, last week, other days — and its first answer **replaces the whole line**.
> `set(lastSeenTextFormatter:)` replaces the line outright:
>
> ```swift theme={null}
> header.set(lastSeenTextFormatter: { user in
>     "Away since \(Date(timeIntervalSince1970: user.lastActiveAt).formatted(date: .omitted, time: .shortened))"
> })
> ```

***

## Actions and Events

### Callback Methods

> [tab] SwiftUI
>
> | Prop | Signature | When |
> | - | - | - |
> | `onBack` | `() -> Void` | the back button is tapped |
> | `onError` | `(CometChatError) -> Void` | a fetch fails |
> | `onNewChatClick` | `() -> Void` | the AI new-chat button is tapped |
> | `onChatHistoryClick` | `() -> Void` | the AI chat-history button is tapped |
> | `onVoiceCallClick` | `(User?, Group?) -> Void` | the voice call button is tapped |
> | `onVideoCallClick` | `(User?, Group?) -> Void` | the video call button is tapped |
> | `onPinnedMessagesClick` | `() -> Void` | the Pinned messages entry is chosen |
> | `onOptionSelected` | `(MenuOption) -> Void` | a menu option is chosen |

> [tab] UIKit
>
> | Setter | Signature | When |
> | - | - | - |
> | `set(onBack:)` | `() -> Void` | the back button is tapped |
> | `set(onError:)` | `(CometChatException) -> Void` | a fetch fails |
> | `set(onVoiceCallClick:)` | `(User?, Group?) -> Void` | the voice call button is tapped |
> | `set(onVideoCallClick:)` | `(User?, Group?) -> Void` | the video call button is tapped |
> | `set(onPinnedMessagesClick:)` | `() -> Void` | the Pinned messages entry is chosen |
> | `onAiNewChatClicked` | `(User) -> Void` | the AI new-chat button is tapped |
> | `onAiChatHistoryClicked` | `(User) -> Void` | the AI chat-history button is tapped |
>
> The same events reach a delegate. Every method is optional, and the closures and the
> delegate both fire.
>
> ```swift theme={null}
> extension ChatViewController: CometChatMessageHeaderDelegate {
>     func onBack() { navigationController?.popViewController(animated: true) }
>     func onError(error: NSError) { print(error.localizedDescription) }
>     func onPinnedMessagesClick() { showPinnedMessages() }
> }
> ```
>
> Set it with `header.delegate = self`.

### Global Events

**Your own actions arrive through the Kit's event bus** — the SDK does not tell you about
what you did yourself. The header listens for:

| Event | Emitted by |
| - | - |
| `userBlocked`, `userUnblocked` | your block / unblock screen |
| `memberKicked`, `memberBanned`, `memberScopeChanged` | the Kit's group-members screen |
| `membersAdded`, `memberJoined`, `groupLeft`, `ownershipChanged` | **your app** — your add-members, join, leave and transfer screens |
| `memberUnbanned` | your banned-members screen |

> [!WARNING]
>
> If you build your own group screens and do not emit these events, the header's member
> count goes stale until the next reconnect. Emit them where the action succeeds.

> [tab] SwiftUI
>
> ```swift theme={null}
> func membersWereAdded(actions: [ActionMessage], users: [CometChatSDK.User],
>                       group: CometChatSDK.Group, by me: CometChatSDK.User) {
>     CometChatEvents.emitGroupEvent(
>         .membersAdded(actions: actions, users: users, group: group, addedBy: me))
> }
> ```

> [tab] UIKit
>
> ```swift theme={null}
> func memberJoined(_ user: CometChatSDK.User, group: CometChatSDK.Group) {
>     CometChatEvents.emitGroupEvent(.memberJoined(user: user, group: group))
> }
> ```

See [Events](https://www.cometchat.com/docs/ui-kit/ios/v6/events.md) for the whole bus.

### SDK Events (Real-Time, Automatic)

The header stays current on its own:

* presence and last-active time, from the SDK — not while either side has blocked the other;
* typing, from the SDK;
* a group's member count when members join, leave, are added, kicked or banned by
  **someone else**, from the SDK;
* after a reconnect, the subject is fetched again.

***

## Functionality

> [tab] SwiftUI
>
> | Parameter | Default | Hides |
> | - | - | - |
> | `hideBackIcon` | `false` | the back button |
> | `hideUserStatus` | `false` | a user's subtitle — presence and last seen |
> | `hideGroupStatus` | `false` | the private / password badge on a group's avatar — **not** the member count |
> | `hideVoiceCallButton` | `true` | the voice call button |
> | `hideVideoCallButton` | `true` | the video call button |
> | `hideNewChatButton` | `true` | the AI new-chat button |
> | `hideChatHistoryButton` | `true` | the AI chat-history button |
> | `hideMenuIcon` | `true` | the ⋯ menu |
>
> The data and formatting parameters are `user`, `group`, `store` (`MessageHeaderStore?`),
> `lastSeenTextFormatter` (`(ChatUser) -> String`), `dateTimeFormatter`, `imageSource`
> (`any ImageSource`, default `CometChatSharedImageSource()`) and `style`
> (`CometChatMessageHeaderStyle`).
>
> The same parts can be hidden for a whole subtree:
>
> ```swift theme={null}
> MyAppRoot()
>     .cometChatMessageHeaderHidden([.backIcon, .groupStatus])
> ```
>
> A subtree can hide more than a header's own flags, never less.

> [tab] UIKit
>
> | Property | Default | Hides |
> | - | - | - |
> | `hideBackButton` | `true` | the back button |
> | `hideUserStatus` | `false` | a user's subtitle |
> | `hideGroupStatus` | `false` | the private / password badge — **not** the member count |
> | `hideVoiceCallButton`, `hideVideoCallButton` | `false` when calling is enabled, else `true` | the call buttons |
> | `hideNewChatButton`, `hideChatHistoryButton` | `true` | the AI buttons |
> | `hideMenuIcon` | `true` | the ⋯ |
>
> The data and formatting setters are `set(user:)`, `set(group:)`, `set(store:)`,
> `set(lastSeenTextFormatter:)` and `set(style:)`, with `dateTimeFormatter`
> (`CometChatDateTimeFormatter?`) as a property.

### AI agents

> [tab] SwiftUI
>
> When the user is an AI agent (`role == "@agentic"`), the header shows the new-chat and
> chat-history buttons and "AI Assistant", and hides the call buttons and presence —
> whatever the flags say. For the next person, the flags apply again. Handle the two buttons:
>
> ```swift theme={null}
> CometChatMessageHeader(
>     user: user,
>     onNewChatClick: { startFreshAgentChat() },
>     onChatHistoryClick: { showAgentHistory() }
> )
> ```

> [tab] UIKit
>
> `set(user:)` with an AI agent (`role == "@agentic"`) turns the AI buttons on and the call
> buttons and presence off — **once**. They stay that way for the next user you set, and
> while the subject is an agent the call and status setters are ignored; the AI-button
> setters still work. Handle the two buttons:
>
> ```swift theme={null}
> header.onAiNewChatClicked = { agent in startFreshAgentChat() }
> header.onAiChatHistoryClicked = { agent in showAgentHistory() }
> ```
>
> ![After an AI agent, a person's header still shows the new-chat and chat-history buttons and no status](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/header-uikit-agentThenPerson.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=84d960a54b82415914facc2ad3fd04af)

***

## Custom View Slots

Each region can be replaced. The slot receives the chat's user or group — whichever the chat is:

> [tab] SwiftUI
>
> Each slot is `(ChatUser?, ChatGroup?) -> AnyView` (`MessageHeaderSlot`).
>
> | Slot | Replaces |
> | - | - |
> | `leadingView` | the avatar, inside the identity pill |
> | `titleView` | the name, inside the identity pill |
> | `subtitleView` | the subtitle — it receives the subject, not the typing state |
> | `auxiliaryView` | the call **and** AI buttons, inside the trailing pill |
> | `trailingView` | adds a view after the menu, inside the trailing pill |
> | `itemView` | the header's whole content — the three elements included |
>
> ```swift theme={null}
> CometChatMessageHeader(
>     group: group,
>     subtitleView: { _, group in
>         AnyView(Text("\(group?.membersCount ?? 0) people").font(.caption))
>     },
>     trailingView: { _, _ in
>         AnyView(Image(systemName: "star"))
>     }
> )
> ```
>
> ![The header with a custom subtitle view in place of the member count](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/header-override-subtitleView.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=c07c2e18e6013d4fdea898f8cb99ba85)
>
> Or as modifiers, for every header in a subtree — an initialiser argument wins:
>
> ```swift theme={null}
> MyAppRoot()
>     .cometChatMessageHeaderTrailingView { _, _ in AnyView(Image(systemName: "star")) }
> ```
>
> The modifiers are `cometChatMessageHeaderLeadingView`, `…TitleView`, `…SubtitleView`,
> `…TrailingView`, `…AuxiliaryView` and `…ItemView`.

> [tab] UIKit
>
> Each slot is `(User?, Group?) -> UIView`.
>
> | Slot | Replaces |
> | - | - |
> | `set(leadingView:)` | the avatar, inside the identity pill |
> | `set(titleView:)` | the name, inside the identity pill |
> | `set(subtitleView:)` | the subtitle — and **switches off all built-in subtitle logic**: status, last seen, member count and typing |
> | `set(auxiliaryView:)` | the call **and** AI buttons, inside the trailing pill |
> | `set(trailView:)` | adds a view after the menu, inside the trailing pill |
> | `set(listItemView:)` | the header's whole content — the three elements included |
>
> ```swift theme={null}
> header.set(trailView: { _, _ in
>     UIImageView(image: UIImage(systemName: "star"))
> })
> ```

***

## Menu Options

> [tab] SwiftUI
>
> The ⋯ appears only when `hideMenuIcon` is `false` **and** there are options — both. It opens
> a native menu on one tap.
>
> ```swift theme={null}
> CometChatMessageHeader(
>     group: group,
>     hideMenuIcon: false,
>     options: [
>         MenuOption(id: "details", title: "Group details", systemImage: "info.circle"),
>         MenuOption(id: "mute", title: "Mute", systemImage: "bell.slash"),
>     ],
>     onOptionSelected: { option in handleHeaderOption(option.id) }
> )
> ```

> [tab] UIKit
>
> `set(options:)` shows the ⋯ when the list is non-empty and hides it when empty. The menu
> opens on one tap.
>
> ```swift theme={null}
> header.set(options: [
>     UIAction(title: "Group details", image: UIImage(systemName: "info.circle")) { _ in showDetails() },
>     UIAction(title: "Mute", image: UIImage(systemName: "bell.slash")) { _ in mute() },
> ])
> ```

### Pinned Messages

> [tab] SwiftUI
>
> `showPinnedMessagesOption` adds a **Pinned messages** entry, first in the menu, and shows the
> ⋯ without `hideMenuIcon: false`. The entry appears only when pinning is enabled for your
> app (`CometChatSession.isPinMessageEnabled()`); with pinning off and no options of yours,
> there is no ⋯. A tap calls `onPinnedMessagesClick` — open
> [Pinned Messages](https://www.cometchat.com/docs/ui-kit/ios/v6/pinned-messages.md) from there:
>
> ```swift theme={null}
> CometChatMessageHeader(
>     group: group,
>     showPinnedMessagesOption: true,
>     onPinnedMessagesClick: { showPinnedMessages() }
> )
> ```

> [tab] UIKit
>
> ```swift theme={null}
> header.showPinnedMessagesOption = true
> header.set(onPinnedMessagesClick: { showPinnedMessages() })
> ```
>
> ![The UIKit header showing the menu button because Pinned Messages is on](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/header-uikit-pinned.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=6df72f56f605b669c54d8f78776218f2)
>
> The entry appears first in the menu when pinning is enabled for your app. Turning the
> option on shows the ⋯ straight away — even when pinning is off, in which case the menu has
> only your options, or nothing. `set(options: [])` hides the ⋯ even with the option on.

***

## Calls

> [tab] SwiftUI
>
> The voice and video buttons are hidden by default. Turning them on shows them only when the
> Calls SDK is linked, calling is enabled, **and** something can show the call — your app,
> through `onVoiceCallClick` / `onVideoCallClick`:
>
> ```swift theme={null}
> CometChatMessageHeader(
>     user: user,
>     hideVideoCallButton: false,
>     hideVoiceCallButton: false,
>     onVideoCallClick: { user, group in startMyCall(user: user, group: group, video: true) },
>     onVoiceCallClick: { user, group in startMyCall(user: user, group: group, video: false) }
> )
> ```

> [tab] UIKit
>
> The call buttons show by default when the Calls SDK is linked and calling is enabled —
> **and** something can show the call: your app, through `set(onVoiceCallClick:)` /
> `set(onVideoCallClick:)` or the delegate.
>
> ```swift theme={null}
> header.set(onVoiceCallClick: { user, group in startMyCall(user: user, group: group, video: false) })
> header.set(onVideoCallClick: { user, group in startMyCall(user: user, group: group, video: true) })
> ```

> [!NOTE]
>
> Calling is enabled with `CometChatSession.initialize(appID:region:enableCalling: true)`,
> and is off by default. The Kit's own call screens are not released yet. Until they are,
> the call buttons render only for an app that handles the tap itself — a button that
> started a call nobody could see would ring the other person while you saw nothing.

The buttons are [`CometChatCallButtons`](https://www.cometchat.com/docs/ui-kit/ios/v6/call-buttons).

***

## Advanced Methods

### Store Access

> [tab] SwiftUI
>
> Pass a `MessageHeaderStore` to seed the header or share it, and to refresh the subject
> yourself:
>
> ```swift theme={null}
> struct RefreshableHeader: View {
>     @State private var store: MessageHeaderStore
>     init(user: CometChatSDK.User) { _store = State(initialValue: MessageHeaderStore(user: user)) }
>
>     var body: some View {
>         CometChatMessageHeader(store: store)
>             .refreshable { await store.refreshUser(uid: store.state.user?.id ?? "") }
>     }
> }
> ```

> [tab] UIKit
>
> `set(store:)` renders a `MessageHeaderStore` you own — to seed it, share it, or refresh the
> subject yourself with `refreshUser(uid:)` / `refreshGroup(guid:)`.

### Subclassing

> [tab] SwiftUI
>
> `CometChatMessageHeader` is a `View` struct. Customise it with its slots, modifiers and
> style.

> [tab] UIKit
>
> Subclass to change presentation:
>
> | Method | Called |
> | - | - |
> | `buildUI()` | once, to build the view tree |
> | `setupStyle()` | when the style or theme changes |
> | `configure(user:)`, `configure(group:)` | on every update |
> | `updateUserStatus(_:)` | for a user's subtitle |
> | `configureGroupSubtitleStyling()` | for a group's subtitle |
> | `configureGroupStatusIndicatorStyling()` | for the group badge |
> | `loadAvatar(_:)` | to load the avatar image — swap in your own loader |
>
> ```swift theme={null}
> final class ThreadHeader: CometChatMessageHeader {
>     override func buildUI() {
>         super.buildUI()
>         let thread = UILabel()
>         thread.text = "Thread"
>         set(titleView: { _, _ in thread })
>     }
> }
> ```
>
> ![A subclassed header reading Thread over the conversation name](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/header-uikit-subclass.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=cf47a764a1d12dfa5fc53575f7bdcfca)

***

## Style

> [tab] SwiftUI
>
> `CometChatMessageHeaderStyle` is sparse: set only what you change, and everything else
> follows the theme.
>
> ```swift theme={null}
> var style = CometChatMessageHeaderStyle()
> style.titleTextColor = .indigo
> style.subtitleTextStyle = .footnote
> style.backIconTint = .indigo
>
> CometChatMessageHeader(user: user, style: style)
> ```
>
> | Property | Default |
> | - | - |
> | `backgroundColor` | fills **every** element. Unset: Liquid Glass on iOS 26, `background1` on iOS 18–25. Set: that colour on every iOS version, replacing the glass |
> | `strokeColor`, `strokeWidth` | outline **each** element on its own. `nil`: the opaque elements keep a one-pixel `strokeLight` edge, glass has none. Set: that width on every element, glass included; `0` is no border |
> | `cornerRadius` | **each** element's corners. `nil` is fully round (a circle or a capsule), `0` is square |
> | `titleTextColor`, `titleTextStyle` | `textPrimary`, `heading4Bold` |
> | `subtitleTextColor`, `subtitleTextStyle` | `textSecondary`, `caption1Regular` |
> | `typingIndicatorTextColor`, `typingIndicatorTextStyle` | `textHighlight`, `caption1Regular` |
> | `backIcon`, `menuIcon`, `newChatIcon`, `chatHistoryIcon` (+ `…Tint`) | SF Symbols in `iconTintPrimary` |
> | `videoCallIcon`, `voiceCallIcon` (+ `…Tint`) | the call buttons' glyphs in the trailing pill |
> | `avatarStyle` | 32pt, `extendedPrimary100` with `primary` initials in `heading4Bold` |
> | `statusIndicatorStyle` | the group badge: 13pt, green for private, amber for password |
>
> ```swift theme={null}
> var style = CometChatMessageHeaderStyle()
> style.backgroundColor = Color(.systemGray6)   // replaces the glass on iOS 26 too
> style.strokeColor = .indigo
> style.strokeWidth = 1
> style.cornerRadius = 12                       // rounded rectangles instead of capsules
> ```
>
> > [!NOTE]
> >
> > `popupMenuStyle` exists but isn't applied: the `⋯` opens the system menu.

> [tab] UIKit
>
> `MessageHeaderStyle` carries 24 properties, and **all are applied** — border and corner
> radius included, to **each** element on its own. Unset properties follow
> `CometChatUIKitTheme`.
>
> ```swift theme={null}
> let style = MessageHeaderStyle()
> style.titleTextColor = .systemIndigo
> style.backIconTint = .systemIndigo
> style.backgroundColor = .systemGray6   // replaces the glass on iOS 26 too
> style.borderColor = .systemIndigo
> style.borderWidth = 1
> style.cornerRadius = 12                // rounded rectangles instead of capsules
> header.set(style: style)
> ```
>
> For every header, set the static default before creating them:
>
> ```swift theme={null}
> CometChatMessageHeader.style.titleTextColor = .systemIndigo
> ```
>
> | Property | Default |
> | - | - |
> | `backgroundColor` | fills **every** element. Unset: Liquid Glass on iOS 26, `background1` on iOS 18–25. Set: that colour on every iOS version, replacing the glass |
> | `borderColor`, `borderWidth` | outline **each** element. Unset: the opaque elements keep a one-pixel `strokeLight` edge, glass has none. Set: that width on every element, glass included; `0` is no border |
> | `cornerRadius` | **each** element's corners. `-1` (the default) is fully round — a circle or a capsule; `0` is square |
> | `titleTextColor`, `titleTextFont` | `textPrimary`, `heading4Bold` |
> | `subtitleTextColor`, `subtitleTextFont` | `textSecondary`, `caption1Regular` |
> | `typingIndicatorTextColor`, `typingIndicatorTextFont` | `textHighlight`, `caption1Regular` |
> | `backIcon`, `menuIcon`, `newChatIcon`, `chatHistoryIcon`, `voiceCallIcon`, `videoCallIcon` (+ `…Tint`) | SF Symbols in `iconTintPrimary` |
> | `avatarStyle` | 32pt, `extendedPrimary100` with `primary` initials in `heading4Bold` |
> | `statusIndicatorStyle` | the group badge — green for private, amber for password |

***

## Next Steps

> [card] [Message List](https://www.cometchat.com/docs/ui-kit/ios/v6/message-list.md)
>
> The messages shown below the header

> [card] [Call Buttons](https://www.cometchat.com/docs/ui-kit/ios/v6/call-buttons.md)
>
> The voice and video buttons the header hosts

> [card] [Pinned Messages](https://www.cometchat.com/docs/ui-kit/ios/v6/pinned-messages.md)
>
> Open from the header's menu

> [card] [Events](https://www.cometchat.com/docs/ui-kit/ios/v6/events.md)
>
> The Kit's event bus


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