Skip to main content

Where It Fits

CometChatCallButtons renders voice and video call buttons. Pass a user for 1-on-1 calls or a group for group calls. Typically embedded in CometChatMessageHeader’s auxiliary view or used standalone. The component handles call initiation, renders CometChatOutgoingCall internally, and manages the full call lifecycle.

Minimal Render

Root CSS class: .cometchat-call-button

Actions and Events

Callback Props

onVoiceCallClick

Overrides the default voice call initiation behavior. When set, clicking the voice button invokes this callback instead of initiating a call via the SDK.

onVideoCallClick

Overrides the default video call initiation behavior.

onError

Fires on internal errors during call initiation.

Global UI Events

CometChatCallEvents emits call lifecycle events subscribable from anywhere.

SDK Events (Real-Time, Automatic)

The component attaches SDK call listeners internally:

Configuring the Outgoing Call Sub-Component

CometChatCallButtons renders CometChatOutgoingCall internally. Customize it via outgoingCallConfiguration.
OutgoingCallConfiguration properties: Refer to CometChatOutgoingCall for details on each view slot.

Call Settings

Customize the calling experience via callSettingsBuilder.

Common Patterns

Voice-only call button

Group call buttons


CSS Architecture

The component uses CSS custom properties (design tokens) defined in @cometchat/chat-uikit-react/css-variables.css. The cascade:
  1. Global tokens set on the .cometchat root wrapper.
  2. Component CSS (.cometchat-call-button) consumes these tokens via var().
  3. Overrides target .cometchat-call-button descendant selectors.

Key Selectors

Example: Themed call buttons

Customization Matrix


Props

All props are optional. Sorted alphabetically.

callSettingsBuilder

Builder function for customizing call settings.

group

The group for group call buttons. Pass either user or group, not both.

hideVideoCallButton

Hides the video call button.

hideVoiceCallButton

Hides the voice call button.

onError

Callback fired when the component encounters an error.

outgoingCallConfiguration

Configuration object for the internal CometChatOutgoingCall sub-component. See Configuring the Outgoing Call Sub-Component for properties.

user

The user for 1-on-1 call buttons. Pass either user or group, not both.

Events

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

CSS Selectors