Documentation Index Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.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" : "Visual notification for incoming voice/video calls with accept and decline controls." ,
"cssRootClass" : ".cometchat-incoming-call" ,
"props" : {
"data" : {
"call" : { "type" : "any" , "default" : "auto-detected" },
"callSettingsBuilder" : { "type" : "(call: CometChat.Call) => CallSettingsBuilder" , "default" : "undefined" }
},
"callbacks" : {
"onAccept" : "(call: CometChat.Call) => void" ,
"onDecline" : "(call: CometChat.Call) => void" ,
"onError" : "((error: CometChat.CometChatException) => void) | null"
},
"sound" : {
"disableSoundForCalls" : { "type" : "boolean" , "default" : false },
"customSoundForCalls" : { "type" : "string" , "default" : "undefined" }
},
"viewSlots" : {
"itemView" : "(call: CometChat.Call) => JSX.Element" ,
"leadingView" : "(call: CometChat.Call) => JSX.Element" ,
"titleView" : "(call: CometChat.Call) => JSX.Element" ,
"subtitleView" : "(call: CometChat.Call) => JSX.Element" ,
"trailingView" : "(call: CometChat.Call) => JSX.Element"
}
},
"events" : [
{ "name" : "CometChatCallEvents.ccCallRejected" , "payload" : "CometChat.Call" },
{ "name" : "CometChatCallEvents.ccCallAccepted" , "payload" : "CometChat.Call" },
{ "name" : "CometChatCallEvents.ccCallEnded" , "payload" : "CometChat.Call" }
]
}
Where It Fits
CometChatIncomingCall is an overlay component that auto-detects incoming calls and renders a notification with accept/decline buttons. Place it at the app root level so it appears above all other content.
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
import "@cometchat/chat-uikit-react/css-variables.css" ;
function App () {
return (
< div style = { { position: "relative" , height: "100vh" } } >
< CometChatIncomingCall />
{ /* rest of app */ }
</ div >
);
}
Minimal Render
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
import "@cometchat/chat-uikit-react/css-variables.css" ;
function IncomingCallDemo () {
return < CometChatIncomingCall /> ;
}
export default IncomingCallDemo ;
Root CSS class: .cometchat-incoming-call
Actions and Events
Callback Props
onAccept
Fires when the accept button is clicked.
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
import { CometChat } from "@cometchat/chat-sdk-javascript" ;
function IncomingCallWithAccept () {
return (
< CometChatIncomingCall
onAccept = { ( call : CometChat . Call ) => {
console . log ( "Call accepted:" , call );
} }
/>
);
}
onDecline
Fires when the decline button is clicked.
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
import { CometChat } from "@cometchat/chat-sdk-javascript" ;
function IncomingCallWithDecline () {
return (
< CometChatIncomingCall
onDecline = { ( call : CometChat . Call ) => {
console . log ( "Call declined:" , call );
} }
/>
);
}
onError
Fires on internal errors.
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
import { CometChat } from "@cometchat/chat-sdk-javascript" ;
function IncomingCallWithError () {
return (
< CometChatIncomingCall
onError = { ( error : CometChat . CometChatException ) => {
console . error ( "IncomingCall error:" , error );
} }
/>
);
}
Global UI Events
CometChatCallEvents emits events subscribable from anywhere in the application.
Event Fires when Payload ccCallRejectedIncoming call is rejected CometChat.CallccCallAcceptedIncoming call is accepted CometChat.CallccCallEndedCall ends CometChat.Call
import { useEffect } from "react" ;
import { CometChatCallEvents } from "@cometchat/chat-uikit-react" ;
import { CometChat } from "@cometchat/chat-sdk-javascript" ;
function useCallEvents () {
useEffect (() => {
const acceptedSub = CometChatCallEvents . ccCallAccepted . subscribe (
( call : CometChat . Call ) => console . log ( "Accepted:" , call )
);
const rejectedSub = CometChatCallEvents . ccCallRejected . subscribe (
( call : CometChat . Call ) => console . log ( "Rejected:" , call )
);
return () => {
acceptedSub ?. unsubscribe ();
rejectedSub ?. unsubscribe ();
};
}, []);
}
SDK Events (Real-Time, Automatic)
The component listens to SDK call events internally for real-time incoming call detection. No manual attachment needed.
Custom View Slots
View slots for CometChatIncomingCall are functions that receive the CometChat.Call object.
Slot Signature Replaces itemView(call: CometChat.Call) => JSX.ElementEntire list item leadingView(call: CometChat.Call) => JSX.ElementAvatar / left section titleView(call: CometChat.Call) => JSX.ElementName / title text subtitleView(call: CometChat.Call) => JSX.ElementSubtitle text trailingView(call: CometChat.Call) => JSX.ElementRight section
leadingView
import { CometChat } from "@cometchat/chat-sdk-javascript" ;
import { CometChatAvatar , CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
function CustomLeadingIncoming () {
return (
< CometChatIncomingCall
leadingView = { ( call : CometChat . Call ) => (
< CometChatAvatar
name = { call . getCallInitiator ()?. getName () }
image = { call . getCallInitiator ()?. getAvatar () }
/>
) }
/>
);
}
titleView
import { CometChat } from "@cometchat/chat-sdk-javascript" ;
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
function CustomTitleIncoming () {
return (
< CometChatIncomingCall
titleView = { ( call : CometChat . Call ) => (
< div > { call . getCallInitiator ()?. getName () } </ div >
) }
/>
);
}
itemView
import { CometChat } from "@cometchat/chat-sdk-javascript" ;
import { CometChatAvatar , CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
function CustomItemViewIncoming () {
return (
< CometChatIncomingCall
itemView = { ( call : CometChat . Call ) => (
< div className = "incoming-call__itemview" >
< CometChatAvatar
name = { call . getCallInitiator ()?. getName () }
image = { call . getCallInitiator ()?. getAvatar () }
/>
< div > { call . getCallInitiator ()?. getName () } </ div >
< div > { "Incoming " + call . getType () + " call" } </ div >
</ div >
) }
/>
);
}
Common Patterns
Disable ringtone
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
function SilentIncoming () {
return < CometChatIncomingCall disableSoundForCalls = { true } /> ;
}
Custom ringtone
import { CometChatIncomingCall } from "@cometchat/chat-uikit-react" ;
function CustomSoundIncoming () {
return < CometChatIncomingCall customSoundForCalls = "/sounds/ringtone.mp3" /> ;
}
CSS Architecture
Key Selectors
Target Selector Root .cometchat-incoming-callList item .cometchat-incoming-call .cometchat-list-itemBody title .cometchat-incoming-call .cometchat-list-item__body-titleButton group .cometchat-incoming-call__button-groupDecline button .cometchat-incoming-call__button-declineAccept button .cometchat-incoming-call__button-accept
Example: Brand-themed incoming call
.cometchat-incoming-call {
border-radius : 18.5 px ;
border : 1.542 px solid #aa9ee8 ;
background : #fff ;
}
.cometchat-incoming-call__button-decline .cometchat-button__text {
color : #f44649 ;
}
.cometchat-incoming-call__button-accept .cometchat-button {
background-color : #6852d6 ;
}
Props
All props are optional.
call
Sets a specific call object for the incoming call display.
Type anyDefault Auto-detected
callSettingsBuilder
Custom call settings builder for the call session.
Type (call: CometChat.Call) => typeof CometChatUIKitCalls.CallSettingsBuilderDefault undefined
customSoundForCalls
Custom sound file URL for incoming calls.
Type stringDefault undefined
disableSoundForCalls
Disables the incoming call ringtone.
itemView
Custom renderer for the entire list item.
Type (call: CometChat.Call) => JSX.ElementDefault undefined
leadingView
Custom renderer for the avatar / left section.
Type (call: CometChat.Call) => JSX.ElementDefault undefined
onAccept
Callback fired when the accept button is clicked.
Type (call: CometChat.Call) => voidDefault undefined
onDecline
Callback fired when the decline button is clicked.
Type (call: CometChat.Call) => voidDefault undefined
onError
Callback fired when the component encounters an error.
Type ((error: CometChat.CometChatException) => void) | nullDefault undefined
subtitleView
Custom renderer for the subtitle text.
Type (call: CometChat.Call) => JSX.ElementDefault undefined
titleView
Custom renderer for the name / title text.
Type (call: CometChat.Call) => JSX.ElementDefault undefined
trailingView
Custom renderer for the right section.
Type (call: CometChat.Call) => JSX.ElementDefault undefined
Events
Event Payload Fires when CometChatCallEvents.ccCallRejectedCometChat.CallCall rejected CometChatCallEvents.ccCallAcceptedCometChat.CallCall accepted CometChatCallEvents.ccCallEndedCometChat.CallCall ended
CSS Selectors
Target Selector Root .cometchat-incoming-callList item .cometchat-incoming-call .cometchat-list-itemBody title .cometchat-incoming-call .cometchat-list-item__body-titleTitle container .cometchat-incoming-call .cometchat-list-item__title-containerTrailing view .cometchat-incoming-call .cometchat-list-item__trailing-viewButton group .cometchat-incoming-call__button-groupDecline button .cometchat-incoming-call__button-declineAccept button .cometchat-incoming-call__button-accept