Skip to main content

Where It Fits

CometChatOutgoingCall is an overlay component that displays the outgoing call screen with the recipient’s name, avatar, and a cancel button. It plays a ringtone while the call is pending. Typically rendered at the app root level after initiating a call via CometChat.initiateCall().

Minimal Render

Root CSS class: .cometchat-outgoing-call

Actions and Events

Callback Props

onCallCanceled

Fires when the cancel button is clicked. Pauses the ringtone internally before invoking the callback.

onError

Fires on internal errors.

Global UI Events

CometChatCallEvents emits call lifecycle events subscribable from anywhere. Subscribe in a useEffect and unsubscribe on cleanup.

SDK Events (Real-Time, Automatic)

The component internally manages call sound playback. It plays the outgoing call ringtone on mount (unless disableSoundForCalls={true}) and pauses it on unmount or cancel. No SDK call listeners are attached by the component itself — call status updates are handled by the parent application.

Custom View Slots

All view slots on CometChatOutgoingCall are JSX.Element (not functions). They do not receive parameters — pass call data via closure if needed.

titleView

Replace the recipient name.

subtitleView

Replace the “Calling…” text.

avatarView

Replace the recipient avatar.

cancelButtonView

Replace the cancel call button.

Common Patterns

Cancel and end the call session

Custom ringtone

Silent outgoing call (no ringtone)


CSS Architecture

The component uses CSS custom properties (design tokens) defined in @cometchat/chat-uikit-react/css-variables.css. The cascade:
  1. Global tokens (e.g., --cometchat-primary-color, --cometchat-error-color) set on the .cometchat root wrapper.
  2. Component CSS (.cometchat-outgoing-call) consumes these tokens via var() with fallback values.
  3. Overrides target .cometchat-outgoing-call descendant selectors in a global stylesheet.

Key Selectors

Example: Themed outgoing call

Customization Matrix


Props

All props are optional unless noted. Sorted alphabetically.

avatarView

Custom JSX replacing the recipient avatar.

call

The outgoing call object from CometChat.initiateCall(). Component renders nothing when call is not provided.

cancelButtonView

Custom JSX replacing the cancel call button.

customSoundForCalls

URL to a custom audio file for the outgoing call ringtone.

disableSoundForCalls

Disables the outgoing call ringtone.

onCallCanceled

Callback fired when the cancel button is clicked.

onError

Callback fired when the component encounters an error.

subtitleView

Custom JSX replacing the “Calling…” subtitle text.

titleView

Custom JSX replacing the recipient name.

Events

All events are Subject<CometChat.Call> from RxJS. Subscribe with .subscribe(), unsubscribe with the returned subscription’s .unsubscribe().

CSS Selectors