AI Integration Quick Reference
AI Integration Quick Reference
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
.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 activeuser 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:| Event | Payload | Fires when |
|---|---|---|
ui:call/outgoing | { call } | A 1-on-1 voice/video call is initiated |
ui:message/sent | { message, status } | A group call meeting message is sent |
Events Received
UI events this component subscribes to (published by other components):| Event | Payload | Behavior |
|---|---|---|
ui:call/rejected | { call } | Clears the active call and re-enables the buttons |
ui:call/ended | {} | Clears the active call and resets all call state |
SDK Listeners (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 |
onOutgoingCallAccepted | Transitions to the ongoing call screen |
onOutgoingCallRejected | Clears the active call and resets state |
Call Settings
Customize the calling experience viacallSettingsBuilder. The builder is forwarded to the internal CometChatOngoingCall session.
Customization
Custom Button Views
UsevoiceCallButtonView and videoCallButtonView to replace the default buttons while keeping the component’s call lifecycle behavior intact.
| Slot | Type | Replaces |
|---|---|---|
voiceCallButtonView | ReactNode | Default voice call button |
videoCallButtonView | ReactNode | Default video call button |
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:- Global tokens set on the
.cometchatroot wrapper. - Component CSS (
.cometchat-call-buttons) consumes these tokens viavar(). - Overrides target
.cometchat-call-buttonsdescendant selectors.
Key Selectors
| Target | Selector |
|---|---|
| Root | .cometchat-call-buttons |
| Button element | .cometchat-call-buttons__button |
| Button icon | .cometchat-call-buttons__button-icon |
| Voice button icon | .cometchat-call-buttons__button-icon--voice |
| Video button icon | .cometchat-call-buttons__button-icon--video |
Example: Themed call buttons

Customization Matrix
| What to change | Where | Property/API | Example |
|---|---|---|---|
| Override call initiation | Component props | onVoiceCallClick / onVideoCallClick | onVoiceCallClick={(entity) => customCall(entity)} |
| Hide a call button | Component props | hideVoiceCallButton / hideVideoCallButton | hideVideoCallButton={true} |
| Replace a button view | Component props | voiceCallButtonView / videoCallButtonView | voiceCallButtonView={<CustomButton />} |
| Customize call settings | Component props | callSettingsBuilder | callSettingsBuilder={(audio) => builder} |
| Change colors, fonts, spacing | Global CSS | Target .cometchat-call-buttons class | .cometchat-call-buttons__button-icon { background: red; } |
Props
All props are optional. Sorted alphabetically.callSettingsBuilder
Builder function for customizing the ongoing call settings.| Type | (isAudioOnlyCall: boolean, user?: CometChat.User, group?: CometChat.Group) => CallSettingsBuilder |
| Default | undefined |
className
Additional CSS class name applied to the root container.| Type | string |
| 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 |
onCallEnded
Callback fired after an ongoing call ends and the component resets its state.| Type | () => void |
| Default | undefined |
onError
Callback fired when the component encounters an error.| Type | ((error: CometChat.CometChatException) => void) | null |
| Default | undefined |
onVideoCallClick
Overrides the default video call initiation. Receives the activeuser or group entity.
| Type | (entity: CometChat.User | CometChat.Group) => void |
| Default | undefined |
onVoiceCallClick
Overrides the default voice call initiation. Receives the activeuser or group entity.
| Type | (entity: CometChat.User | CometChat.Group) => void |
| Default | undefined |
user
The user for 1-on-1 call buttons. Pass eitheruser or group, not both.
| Type | CometChat.User |
| Default | undefined |
videoCallButtonView
Custom view that replaces the default video call button.| Type | ReactNode |
| Default | undefined |
voiceCallButtonView
Custom view that replaces the default voice call button.| Type | ReactNode |
| Default | undefined |
CSS Selectors
| Target | Selector |
|---|---|
| Root | .cometchat-call-buttons |
| Button element | .cometchat-call-buttons__button |
| Button icon | .cometchat-call-buttons__button-icon |
| Voice button icon | .cometchat-call-buttons__button-icon--voice |
| Video button icon | .cometchat-call-buttons__button-icon--video |
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