AI Integration Quick Reference
AI Integration Quick Reference
Where It Fits
CometChatMessageHeader is a toolbar component that sits above CometChatMessageList and CometChatMessageComposer. It receives a user or group prop and displays the conversation’s avatar, name, online status, and typing indicator. Call buttons are rendered automatically when the calling extension is enabled.

Minimal Render
.cometchat-message-header
Actions and Events
Callback Props
onBack
Fires when the back button is clicked. RequiresshowBackButton={true}.
onItemClick
Fires when the header list item area (avatar + name) is clicked.onSearchOptionClicked
Fires when the search option is clicked. RequiresshowSearchOption={true}.
onError
Fires on internal errors.SDK Events (Real-Time, Automatic)
The component listens to these SDK events internally. No manual attachment needed.In React 18 StrictMode,
useEffect runs twice on mount in development. The component handles listener cleanup internally.Custom View Slots
View slots forCometChatMessageHeader are JSX.Element (not functions) — unlike list components where slots receive a data parameter.
itemView
Replace the entire list item (avatar + name + subtitle).
- TypeScript
- CSS
titleView
Replace the name / title text.
- TypeScript
- CSS
subtitleView
Replace the subtitle text (status / typing indicator area).
leadingView
Replace the avatar / left section.
- TypeScript
- CSS
trailingView
Replace the right section (call buttons area).
auxiliaryButtonView
Replace the auxiliary button area (next to call buttons).
lastActiveAtDateTimeFormat
Customize the “last seen” timestamp format using aCalendarObject.
If no property is passed in the CalendarObject, the component checks the global configuration first. If also missing there, the component’s default formatting applies.
Common Patterns
Header with back button and search
Hide call buttons
Group header with AI summary
CSS Architecture
The component uses CSS custom properties (design tokens) defined in@cometchat/chat-uikit-react/css-variables.css. The cascade:
- Global tokens are set on the
.cometchatroot wrapper. - Component CSS (
.cometchat-message-header) consumes these tokens viavar()with fallback values. - Overrides target
.cometchat-message-headerdescendant selectors in a global stylesheet.
Key Selectors
Example: Brand-themed header

Customization Matrix
Props
All props are optional unless noted otherwise.auxiliaryButtonView
Custom component for the auxiliary button area.enableAutoSummaryGeneration
Enables automatic conversation summary generation.group
Displays group details in the header.
Pass either
user or group, not both.
hideBackButton
Hides the back navigation button. Deprecated — useshowBackButton instead.
hideUserStatus
Hides the user’s online/offline status indicator.hideVideoCallButton
Hides the video call button.hideVoiceCallButton
Hides the voice call button.itemView
Custom component for the entire list item.lastActiveAtDateTimeFormat
Format for displaying the “last seen” timestamp.leadingView
Custom component for the avatar / left section.onBack
Callback fired when the back button is clicked.onError
Callback fired when the component encounters an error.onItemClick
Callback fired when the header list item is clicked.onSearchOptionClicked
Callback fired when the search option is clicked.showBackButton
Shows the back navigation button.showConversationSummaryButton
Shows the AI conversation summary button.showSearchOption
Shows the search option in the header.subtitleView
Custom component for the subtitle text.summaryGenerationMessageCount
Number of messages used for AI summary generation.titleView
Custom component for the name / title text.trailingView
Custom component for the right section.user
Displays user details in the header.
Pass either
user or group, not both.