AI Agent Component Spec
AI Agent Component Spec
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
.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.
| Event | Fires when | Payload |
|---|---|---|
ccOutgoingCall | User initiates a voice/video call | CometChat.Call |
ccCallRejected | Initiated call is rejected/cancelled | CometChat.Call |
ccCallEnded | Call session ends | CometChat.Call |
SDK Events (Real-Time, Automatic)
The component attaches SDK call listeners internally:| SDK Listener | Internal behavior |
|---|---|
onIncomingCallReceived | Disables call buttons to prevent concurrent calls |
onIncomingCallCancelled | Re-enables call buttons |
onOutgoingCallRejected | Hides outgoing call screen, re-enables buttons |
onOutgoingCallAccepted | Transitions to ongoing call screen |
Configuring the Outgoing Call Sub-Component
CometChatCallButtons renders CometChatOutgoingCall internally. Customize it via outgoingCallConfiguration.
OutgoingCallConfiguration properties:
| Property | Type | Description |
|---|---|---|
disableSoundForCalls | boolean | Disables outgoing call ringtone |
customSoundForCalls | string | Custom ringtone URL |
onError | (error: CometChat.CometChatException) => void | Error callback |
onCallCanceled | Function | Cancel button callback |
titleView | (call: CometChat.Call) => JSX.Element | Custom title |
subtitleView | (call: CometChat.Call) => JSX.Element | Custom subtitle |
avatarView | (call: CometChat.Call) => JSX.Element | Custom avatar |
cancelButtonView | (call: CometChat.Call) => JSX.Element | Custom cancel button |
Call Settings
Customize the calling experience viacallSettingsBuilder.
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:
- Global tokens set on the
.cometchatroot wrapper. - Component CSS (
.cometchat-call-button) consumes these tokens viavar(). - Overrides target
.cometchat-call-buttondescendant selectors.
Key Selectors
| Target | Selector |
|---|---|
| Root | .cometchat-call-button |
| Voice button wrapper | .cometchat-call-button__voice |
| Video button wrapper | .cometchat-call-button__video |
| Button element | .cometchat-call-button .cometchat-button |
| Button icon | .cometchat-call-button .cometchat-button__icon |
| Outgoing call backdrop | .cometchat-outgoing-call__backdrop |
Example: Themed call buttons

Customization Matrix
| What to change | Where | Property/API | Example |
|---|---|---|---|
| Override call initiation | Component props | onVoiceCallClick / onVideoCallClick | onVoiceCallClick={() => customCall()} |
| Hide a call button | Component props | hideVoiceCallButton / hideVideoCallButton | hideVideoCallButton={true} |
| Customize outgoing call UI | Component props | outgoingCallConfiguration | outgoingCallConfiguration={new OutgoingCallConfiguration({...})} |
| Customize call settings | Component props | callSettingsBuilder | callSettingsBuilder={(audio) => builder} |
| Change colors, fonts, spacing | Global CSS | Target .cometchat-call-button class | .cometchat-call-button .cometchat-button__icon { background: red; } |
Accessibility
The voice and video call buttons are keyboard-focusable and activate on Enter/Space. Each button includes hover text (“Voice Call” / “Video Call”) for tooltip display. Buttons are disabled during active calls to prevent concurrent call initiation.Props
All props are optional. Sorted alphabetically.callSettingsBuilder
Builder function for customizing call settings.| Type | (isAudioOnlyCall: boolean, user?: CometChat.User, group?: CometChat.Group) => typeof CometChatUIKitCalls.CallSettingsBuilder |
| Default | undefined |
group
The group for group call buttons. Pass eitheruser or group, not both.
| Type | CometChat.Group |
| Default | undefined |
hideVideoCallButton
Hides the video call button.| Type | boolean |
| Default | false |
hideVoiceCallButton
Hides the voice call button.| Type | boolean |
| Default | false |
onError
Callback fired when the component encounters an error.| Type | ((error: CometChat.CometChatException) => void) | null |
| Default | undefined |
outgoingCallConfiguration
Configuration object for the internalCometChatOutgoingCall sub-component.
| Type | OutgoingCallConfiguration |
| Default | new OutgoingCallConfiguration({}) |
user
The user for 1-on-1 call buttons. Pass eitheruser or group, not both.
| Type | CometChat.User |
| Default | undefined |
Events
| Event | Payload | Fires when |
|---|---|---|
CometChatCallEvents.ccOutgoingCall | CometChat.Call | Call initiated |
CometChatCallEvents.ccCallRejected | CometChat.Call | Call rejected/cancelled |
CometChatCallEvents.ccCallEnded | CometChat.Call | Call session ends |
CometChatMessageEvents.ccMessageSent | IMessages | Group call message sent |
Subject<CometChat.Call> from RxJS. Subscribe with .subscribe(), unsubscribe with the returned subscription’s .unsubscribe().
CSS Selectors
| Target | Selector |
|---|---|
| Root | .cometchat-call-button |
| Voice button wrapper | .cometchat-call-button__voice |
| Video button wrapper | .cometchat-call-button__video |
| Button element | .cometchat-call-button .cometchat-button |
| Button icon | .cometchat-call-button .cometchat-button__icon |
| Outgoing call backdrop | .cometchat-outgoing-call__backdrop |