Documentation Index Fetch the complete documentation index at: https://cometchat-22654f5b-react-uikit-v7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
{
"component" : "CometChatIncomingCall" ,
"package" : "@cometchat/chat-uikit-react" ,
"import" : "import { CometChatIncomingCall } from \" @cometchat/chat-uikit-react \" ;" ,
"cssImport" : "import \" @cometchat/chat-uikit-react/css-variables.css \" ;" ,
"description" : "Displays an incoming call notification with caller info, accept/decline buttons, and transitions to the ongoing call screen." ,
"cssRootClass" : ".cometchat-incoming-call" ,
"primaryOutput" : {
"prop" : "onAccept" ,
"type" : "(call: CometChat.Call) => void"
},
"props" : {
"callbacks" : {
"onAccept" : "(call: CometChat.Call) => void" ,
"onDecline" : "(call: CometChat.Call) => void" ,
"onCallEnded" : "() => void" ,
"onError" : "((error: CometChat.CometChatException) => void) | null"
},
"sound" : {
"disableSoundForCalls" : { "type" : "boolean" , "default" : false },
"customSoundForCalls" : { "type" : "string" , "default" : "built-in" }
},
"configuration" : {
"callSettingsBuilder" : {
"type" : "(call: CometChat.Call) => any" ,
"default" : "undefined" ,
"note" : "Custom call settings for the ongoing call session after accepting"
}
},
"viewSlots" : {
"itemView" : "(call: CometChat.Call) => ReactNode" ,
"leadingView" : "(call: CometChat.Call) => ReactNode" ,
"titleView" : "(call: CometChat.Call) => ReactNode" ,
"subtitleView" : "(call: CometChat.Call) => ReactNode" ,
"trailingView" : "(call: CometChat.Call) => ReactNode"
}
},
"events" : [
{
"name" : "ui:call/rejected" ,
"payload" : "{ call }" ,
"description" : "Call declined by user"
},
{
"name" : "ui:call/ended" ,
"payload" : "{}" ,
"description" : "Ongoing call ended"
}
],
"sdkListeners" : [
"onIncomingCallReceived" ,
"onIncomingCallCancelled" ,
"onOutgoingCallAccepted" ,
"onOutgoingCallRejected"
],
"types" : {
"CometChatDateFormatConfig" : {
"today" : "string | undefined" ,
"yesterday" : "string | undefined" ,
"lastWeek" : "string | undefined" ,
"otherDays" : "string | undefined"
}
}
}
Overview
CometChatIncomingCall is a full-screen notification component that automatically listens for incoming calls via the CometChat SDK CallListener. When an incoming call is detected, it displays the caller’s avatar, name, and call type (Voice/Video) with accept and decline buttons.
The component handles:
Automatic detection of incoming calls via SDK CallListener
Caller avatar, name, and call type display (Voice/Video)
Accept button — transitions to CometChatOngoingCall internally
Decline button — rejects the call via SDK
Incoming call sound playback (looping while notification is visible)
Self-managed visibility (renders nothing when no incoming call is active)
Placement: Render CometChatIncomingCall at your app’s root level. It manages its own visibility internally and only appears when an incoming call is detected.
Note: In v7, CallButtons is not a standalone component — call button functionality is part of CometChatMessageHeader. Use CometChatIncomingCall separately to handle the incoming call notification flow.
Usage
Flat API
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
function App () {
return (
< div >
{ /* Your app content */ }
< CometChatIncomingCall
onAccept = { ( call ) => {
console . log ( "Call accepted:" , call . getSessionId ());
} }
onDecline = { ( call ) => {
console . log ( "Call declined:" , call . getSessionId ());
} }
onCallEnded = { () => {
console . log ( "Call ended" );
} }
/>
</ div >
);
}
Full Layout Example
import {
CometChatConversations ,
CometChatMessageHeader ,
CometChatMessageList ,
CometChatMessageComposer ,
CometChatIncomingCall ,
} from "@cometchat/chat-uikit-react" ;
function ChatApp () {
return (
< div style = { { display: "flex" , height: "100vh" } } >
< div style = { { width: 360 } } >
< CometChatConversations onItemClick = { handleConversationClick } />
</ div >
< div style = { { flex: 1 , display: "flex" , flexDirection: "column" } } >
< CometChatMessageHeader user = { user } group = { group } />
< CometChatMessageList user = { user } group = { group } />
< CometChatMessageComposer user = { user } group = { group } />
</ div >
{ /* Render at root level — manages its own visibility */ }
< CometChatIncomingCall />
</ div >
);
}
Actions and Events
Callback Props
Prop Signature Fires when onAccept(call: CometChat.Call) => voidUser clicks the accept button onDecline(call: CometChat.Call) => voidUser clicks the decline button onCallEnded() => voidOngoing call session ends onError((error: CometChat.CometChatException) => void) | nullSDK error occurs
Events Emitted
UI events this component publishes:
Event Payload Fires when ui:call/rejected{ call }Call declined by user ui:call/ended{}Ongoing call ended
Events Received
This component does not subscribe to any UI events from other components.
SDK Listeners (Automatic)
These SDK CallListener callbacks are attached internally. The component updates its state automatically:
onIncomingCallReceived — shows the incoming call notification
onIncomingCallCancelled — hides the notification (caller cancelled)
onOutgoingCallAccepted — transitions to ongoing call screen
onOutgoingCallRejected — hides the notification (call rejected elsewhere)
Customization
View Props
Use view props to replace sections of the default UI while keeping the component’s behavior intact:
< CometChatIncomingCall
leadingView = { ( call ) => < MyCustomAvatar call = { call } /> }
titleView = { ( call ) => < span > { call . getSender (). getName () } </ span > }
subtitleView = { ( call ) => < span > Incoming { call . getType () } call </ span > }
/>
Slot Signature Replaces itemView(call: CometChat.Call) => ReactNodeEntire call notification card leadingView(call: CometChat.Call) => ReactNodeAvatar section titleView(call: CometChat.Call) => ReactNodeCaller name subtitleView(call: CometChat.Call) => ReactNodeCall type label trailingView(call: CometChat.Call) => ReactNodeTrailing section
CSS Styling
Override design tokens on the component selector:
.cometchat-incoming-call {
--cometchat-background-color-01 : #1a1a2e ;
--cometchat-text-color-primary : #ffffff ;
}
.cometchat-incoming-call__button-accept {
background : var ( --cometchat-success-color );
}
.cometchat-incoming-call__button-decline {
background : var ( --cometchat-error-color );
}
Props
All props are optional.
onAccept
Custom accept handler. When provided, overrides the default CometChat.acceptCall behavior.
Type (call: CometChat.Call) => voidDefault undefined
onDecline
Custom decline handler. When provided, overrides the default CometChat.rejectCall behavior.
Type (call: CometChat.Call) => voidDefault undefined
onCallEnded
Callback when the ongoing call session ends and the call screen should close.
Type () => voidDefault undefined
disableSoundForCalls
Disable the incoming call ringtone sound.
customSoundForCalls
Custom sound URL to play for incoming calls (replaces the built-in ringtone).
Type stringDefault Built-in ringtone
callSettingsBuilder
Custom call settings builder for the ongoing call session after accepting. If not provided, the component uses default settings.
Type (call: CometChat.Call) => anyDefault undefined
< CometChatIncomingCall
callSettingsBuilder = { ( call ) => {
return new CometChat . CallSettingsBuilder ()
. enableDefaultLayout ( true )
. setIsAudioOnlyCall ( call . getType () === "audio" )
. build ();
} }
/>
onError
Callback when an SDK error occurs.
Type ((error: CometChat.CometChatException) => void) | nullDefault null
itemView
Custom renderer for the entire incoming call notification card.
Type (call: CometChat.Call) => ReactNodeDefault undefined
leadingView
Custom renderer for the avatar section.
Type (call: CometChat.Call) => ReactNodeDefault undefined
titleView
Custom renderer for the caller name.
Type (call: CometChat.Call) => ReactNodeDefault undefined
subtitleView
Custom renderer for the call type label (Voice/Video).
Type (call: CometChat.Call) => ReactNodeDefault undefined
trailingView
Custom renderer for the trailing section.
Type (call: CometChat.Call) => ReactNodeDefault undefined
className
Additional CSS class name applied to the root element.
Type stringDefault undefined
CSS Selectors
Target Selector Root container .cometchat-incoming-callInfo section .cometchat-incoming-call__infoAvatar .cometchat-incoming-call__avatarDetails container .cometchat-incoming-call__detailsTitle .cometchat-incoming-call__titleSubtitle .cometchat-incoming-call__subtitleTrailing section .cometchat-incoming-call__trailingButton group .cometchat-incoming-call__button-groupAccept button .cometchat-incoming-call__button-acceptDecline button .cometchat-incoming-call__button-decline
Next Steps
Outgoing Call Display the outgoing call screen while waiting for the receiver to answer
Call Logs Browse call history and re-initiate calls
Theming Customize colors, fonts, and spacing