AI Integration Quick Reference
AI Integration Quick Reference
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.
Live Preview — interact with the default incoming call screen.Open in Storybook ↗
The component handles:
- Automatic detection of incoming calls via SDK
CallListener - Caller avatar, name, and call type display (Voice/Video)
- Accept button — transitions to
CometChatOngoingCallinternally - 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,CallButtonsis not a standalone component — call button functionality is part ofCometChatMessageHeader. UseCometChatIncomingCallseparately to handle the incoming call notification flow.
Usage
Flat API
Full Layout Example
Actions and Events
Callback Props
| Prop | Signature | Fires when |
|---|---|---|
onAccept | (call: CometChat.Call) => void | User clicks the accept button |
onDecline | (call: CometChat.Call) => void | User clicks the decline button |
onCallEnded | () => void | Ongoing call session ends |
onError | ((error: CometChat.CometChatException) => void) | null | SDK 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 SDKCallListener callbacks are attached internally. The component updates its state automatically:
onIncomingCallReceived— shows the incoming call notificationonIncomingCallCancelled— hides the notification (caller cancelled)onOutgoingCallAccepted— transitions to ongoing call screenonOutgoingCallRejected— 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:| Slot | Signature | Replaces |
|---|---|---|
itemView | (call: CometChat.Call) => ReactNode | Entire call notification card |
leadingView | (call: CometChat.Call) => ReactNode | Avatar section |
titleView | (call: CometChat.Call) => ReactNode | Caller name |
subtitleView | (call: CometChat.Call) => ReactNode | Call type label |
trailingView | (call: CometChat.Call) => ReactNode | Trailing section |
leadingView

titleView

itemView

CSS Styling
Override design tokens on the component selector:Props
All props are optional.onAccept
Custom accept handler. When provided, overrides the defaultCometChat.acceptCall behavior.
| Type | (call: CometChat.Call) => void |
| Default | undefined |
onDecline
Custom decline handler. When provided, overrides the defaultCometChat.rejectCall behavior.
| Type | (call: CometChat.Call) => void |
| Default | undefined |
onCallEnded
Callback when the ongoing call session ends and the call screen should close.| Type | () => void |
| Default | undefined |
disableSoundForCalls
Disable the incoming call ringtone sound.| Type | boolean |
| Default | false |
customSoundForCalls
Custom sound URL to play for incoming calls (replaces the built-in ringtone).| Type | string |
| Default | 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) => any |
| Default | undefined |
onError
Callback when an SDK error occurs.| Type | ((error: CometChat.CometChatException) => void) | null |
| Default | null |
itemView
Custom renderer for the entire incoming call notification card.| Type | (call: CometChat.Call) => ReactNode |
| Default | undefined |
leadingView
Custom renderer for the avatar section.| Type | (call: CometChat.Call) => ReactNode |
| Default | undefined |
titleView
Custom renderer for the caller name.| Type | (call: CometChat.Call) => ReactNode |
| Default | undefined |
subtitleView
Custom renderer for the call type label (Voice/Video).| Type | (call: CometChat.Call) => ReactNode |
| Default | undefined |
trailingView
Custom renderer for the trailing section.| Type | (call: CometChat.Call) => ReactNode |
| Default | undefined |
className
Additional CSS class name applied to the root element.| Type | string |
| Default | undefined |
CSS Selectors
| Target | Selector |
|---|---|
| Root container | .cometchat-incoming-call |
| Info section | .cometchat-incoming-call__info |
| Avatar | .cometchat-incoming-call__avatar |
| Details container | .cometchat-incoming-call__details |
| Title | .cometchat-incoming-call__title |
| Subtitle | .cometchat-incoming-call__subtitle |
| Trailing section | .cometchat-incoming-call__trailing |
| Button group | .cometchat-incoming-call__button-group |
| Accept button | .cometchat-incoming-call__button-accept |
| Decline 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