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. It is typically embedded in CometChatMessageHeader’s auxiliary view or used standalone. The component is self-contained: clicking a button initiates the call, renders CometChatOutgoingCall internally while waiting for an answer, transitions to CometChatOngoingCall on acceptance, and cleans up when the call ends.
Live Preview — interact with the call buttons component.Open in Storybook ↗

Minimal Render

Root CSS class: .cometchat-call-buttons

Actions and Events

Callback Props

onVoiceCallClick

Overrides the default voice call initiation behavior. When set, clicking the voice button invokes this callback (with the active user or group entity) instead of initiating a call via the SDK.

onVideoCallClick

Overrides the default video call initiation behavior.

onCallEnded

Fires after an ongoing call session ends and the component has reset its internal state.

onError

Fires on internal errors during call initiation.

Events Emitted

UI events this component publishes during the call lifecycle:

Events Received

UI events this component subscribes to (published by other components):

SDK Listeners (Real-Time, Automatic)

The component attaches SDK call listeners internally:

Call Settings

Customize the calling experience via callSettingsBuilder. The builder is forwarded to the internal CometChatOngoingCall session.

Customization

Custom Button Views

Use voiceCallButtonView and videoCallButtonView to replace the default buttons while keeping the component’s call lifecycle behavior intact.

Common Patterns

Voice-only call button

Group call buttons


CSS Architecture

The component uses CSS custom properties (design tokens) provided by the UI Kit. The cascade:
  1. Global tokens set on the .cometchat root wrapper.
  2. Component CSS (.cometchat-call-buttons) consumes these tokens via var().
  3. Overrides target .cometchat-call-buttons descendant selectors.

Key Selectors

Example: Themed call buttons

Customization Matrix


Props

All props are optional. Sorted alphabetically.

callSettingsBuilder

Builder function for customizing the ongoing call settings.

className

Additional CSS class name applied to the root container.

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.

onCallEnded

Callback fired after an ongoing call ends and the component resets its state.

onError

Callback fired when the component encounters an error.

onVideoCallClick

Overrides the default video call initiation. Receives the active user or group entity.

onVoiceCallClick

Overrides the default voice call initiation. Receives the active user or group entity.

user

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

videoCallButtonView

Custom view that replaces the default video call button.

voiceCallButtonView

Custom view that replaces the default voice call button.

CSS Selectors


Next Steps

Outgoing Call

Customize the outgoing call screen shown while waiting for an answer

Incoming Call

Handle incoming call notifications with accept/decline actions

Call Logs

Browse call history and re-initiate calls

Theming

Customize colors, fonts, and spacing