Skip to main content

Where It Fits

CometChatMessageHeader is a Component that showcases the User or Group details in the toolbar. It presents a typing indicator and a back navigation button for ease of use.

Minimal Render


Actions and Events

Callback Props

onError

Fires on internal errors (network failure, auth issue, SDK exception).

onBack

Fires when the back button in the app bar is pressed. Requires showBackButton={true}.

onNewChatButtonClick

Fires when the new chat button is pressed (only applies to AI Assistant users). Allows handling starting a new conversation with the AI assistant.

onChatHistoryButtonClick

Fires when the chat history button is pressed (only applies to AI Assistant users). Allows handling opening the AI assistant chat history.

Custom View Slots

Each slot replaces a section of the default UI. Slots that accept parameters receive the user or group object for customization.
SlotSignatureReplaces
ItemView({ user, group }) => JSX.ElementEntire header layout
LeadingView({ user, group }) => JSX.ElementAvatar / left section
TitleView({ user, group }) => JSX.ElementName / title text
SubtitleView({ user, group }) => JSX.ElementStatus / subtitle text
TrailingView({ user, group }) => JSX.ElementRight section next to call buttons
AuxiliaryButtonView({ user, group }) => JSX.ElementReplaces default call buttons

TitleView

Custom view for the name / title text.

AuxiliaryButtonView

Custom buttons that replace the default call buttons.

ItemView

Custom view for the entire header layout.

SubtitleView

Custom view for the subtitle / status text.

LeadingView

Custom view for the avatar / left section.

TrailingView

Custom view for the right section next to call buttons.

Styling

Using Style you can customize the look and feel of the component in your app. Pass a styling object as a prop to the CometChatMessageHeader component.

Visibility Props

PropertyDescriptionCode
showBackButtonToggle visibility of the back button in the app barshowBackButton?: boolean
hideVoiceCallButtonToggle visibility of the voice call buttonhideVoiceCallButton?: boolean
hideVideoCallButtonToggle visibility of the video call buttonhideVideoCallButton?: boolean
usersStatusVisibilityToggle user status visibilityusersStatusVisibility?: boolean
hideNewChatButtonToggle visibility of new chat button for AI AssistantshideNewChatButton?: boolean
hideChatHistoryButtonToggle visibility of chat history button for AI AssistantshideChatHistoryButton?: boolean

options

Custom menu items for the header options menu.

Next Steps

Message List

Display the list of messages in a conversation

Message Composer

Compose and send messages in a chat

Messages

Complete messaging interface with header, list, and composer

Component Styling

Customize the appearance of UI Kit components