CometChatThreadHeader renders the parent message bubble and reply count for a threaded conversation. It requires a parent message to display.

Where It Fits
CometChatThreadHeader is a header component for threaded message views. Wire it above a CometChatMessageList and CometChatMessageComposer to build a complete threaded conversation layout.
- Kotlin (XML Views)
- Jetpack Compose
activity_thread.xml
Quick Start
- Kotlin (XML Views)
- Jetpack Compose
Add to your layout XML:Set the parent message — this is required:
CometChatUIKit.init(), a user logged in, and the UI Kit dependency added.
Actions and Events
Callback Methods
CometChatThreadHeader is a display-only header. It does not expose component-specific callbacks like setOnItemClick or setOnError. The one interactive element is the subscription bell — see Thread Subscription below.
SDK Events (Real-Time, Automatic)
The component listens to SDK events internally via its ViewModel. No manual setup needed.Functionality
Thread Subscription
On Android the subscription bell belongs toCometChatThreadHeader — it renders as a trailing control on this component’s reply-count row. Thread subscription is enabled by default from v6.1.0; on v6.0.x the bell renders only after UIKitSettings.setEnableThreadSubscription(true). It flips optimistically on tap, reverts with a toast if the server rejects the change, and stays in step with the message list’s Subscribe / Unsubscribe action sheet option.
- Kotlin (XML Views)
- Jetpack Compose
app:cometchatThreadSubscriptionVisibility.ThreadSubscriptionBell in your own top bar:
threadSubscriptionView replaces the bell in the reply-count row. It is the escape hatch for putting your own control there — it does not move the bell to the top bar.
The same subscribe/unsubscribe action is also offered as a message option on CometChatMessageList, hidden independently with setThreadSubscriptionOptionVisibility(View.GONE) — an integrator may want one surface and not the other. See the Thread Subscription guide for the full feature.
Style
- Kotlin (XML Views)
- Jetpack Compose
Define a custom style in
themes.xml:themes.xml

ViewModel
- Kotlin (XML Views)
- Jetpack Compose
Next Steps
Message List
Display messages in a conversation
Message Header
Display user/group info in the toolbar
Message Composer
Rich input for sending messages
Conversations
Browse recent conversations