AI Integration Quick Reference
AI Integration Quick Reference
Overview
CometChatThreadHeader displays the parent message bubble and reply count for threaded conversations. It renders a top bar with the thread title, sender name, and close button, followed by the parent message bubble and a real-time reply count divider. Wire it above a CometChatMessageList (with parentMessageId) and CometChatMessageComposer to build a complete thread view.
Live Preview — interact with the default thread header.Open in Storybook ↗
The component handles:
- Rendering the parent message as a bubble
- Real-time reply count updates via SDK listeners
- Parent message edit/delete detection
- Close button and keyboard (Escape) dismissal
Usage
Flat API
Compound Composition
Full Layout Example
Filtering
This component does not support request builders or filtering. It renders a single parent message and its reply count.Actions and Events
Callback Props
Events Emitted
This component does not emit UI events.Events Received
UI events this component subscribes to (published by other components):SDK Listeners (Automatic)
These SDK listeners are attached internally. The component updates its state automatically — no manual subscription needed:- Message listeners:
onTextMessageReceived,onMediaMessageReceived,onCustomMessageReceived,onInteractiveMessageReceived— increments reply count when other users send replies - Edits:
onMessageEdited— updates parent bubble when edited by another user - Deletes:
onMessageDeleted— triggersonParentDeletedwhen deleted by another user
Customization
View Props
Use view props to replace sections of the default UI while keeping the component’s behavior intact:messageBubbleView
Replace the parent message bubble with a custom view.Compound Composition
For full layout control, use sub-components. Omit any sub-component to hide it:CSS Styling
Override design tokens on the component selector:Props
parentMessage is required. All other props are optional.
View slot props (
headerView, messageBubbleView, subtitleView) are convenience props available only on the flat API. In compound composition mode, use the corresponding sub-components directly.parentMessage
The parent message of the thread. Required.hideReceipts
Hide message delivery/read receipts on the parent bubble.hideDate
Hide the date chip shown above the parent bubble.hideReplyCount
Hide the reply count section below the parent bubble.separatorDateTimeFormat
Custom date/time format for the date chip shown above the parent bubble.messageSentAtDateTimeFormat
Custom date/time format for the sent-at timestamp on the parent message bubble.showScrollbar
Show the native scrollbar on the bubble wrapper area.onClose
Callback when the close button is clicked or Escape is pressed.onSubtitleClicked
Callback when the sender name / subtitle is clicked (navigate to parent in main list).onParentDeleted
Callback when the parent message is deleted (thread should close).onError
Callback when an SDK error occurs.headerView
Custom content to replace the entire top bar (title + sender name + close button).messageBubbleView
Custom content to replace the parent message bubble rendering.subtitleView
Custom subtitle view below the title.CSS Selectors
Next Steps
Message List
Display threaded replies below the parent message
Message Composer
Compose replies in the thread
Theming
Customize colors, fonts, and spacing