RealTimeX
Start For Free

RealTimeX

Package Documentation

IntroductionPrerequisitesInstallationProject setupQuick start
Package structureConfigurationComponentsHooksAPI integrationSocket events
OverviewReplace entire UIReplace componentsStyle with classNamesThemes & localePhone & video callingIn-call control barFeatures
TroubleshootingFAQVersion historyBest practicesSupport & contact

Package Reference

Phone & video calling

Overview

Call buttons appear only in direct-message chats and are hidden for groups. The package owns the UI affordances; you own the calling SDK. Control visibility and callbacks through the features prop (showPhoneCall, showVideoCall, onPhoneCall, onVideoCall), or replace the buttons entirely with the options below.

Choose Option A when the default icons are fine, Option B when you need a custom button group, or Option C when you want per-button replacements (or to hide calls completely). Tenant-level call toggles live in the API Settings docs; feature overview is on Features.

Option A — Keep default buttons, add your own callbacks

Fastest path: keep package buttons and wire your voice/video SDK inside the callbacks. Each callback receives the active channel and conversation id.

tsx
features={{
  showPhoneCall: true,
  showVideoCall: true,
  onPhoneCall: ({ activeChannel, conversationId }) => {
    yourVoiceSDK.start(activeChannel.id, conversationId);
  },
  onVideoCall: ({ activeChannel, conversationId }) => {
    yourVideoSDK.start(activeChannel.id, conversationId);
  },
}}

Option B — Replace the entire call button group

Pass a custom HeaderCallActions component when you need different icons, ordering, or labels than the defaults.

tsx
components={{
  HeaderCallActions: ({ onPhoneCall, onVideoCall, activeChannel }) => (
    <div className="flex gap-2">
      <button onClick={onPhoneCall}>Call {activeChannel.name}</button>
      <button onClick={onVideoCall}>Video</button>
    </div>
  ),
}}

Warning

Do not import HeaderCallActions from the package inside your own custom HeaderCallActions implementation — that causes infinite recursion. Render your own buttons instead.

Option C — Replace individual call buttons

Override PhoneCallButton and/or VideoCallButton when you only need one branded control. To hide calls entirely without custom components:

features={{ showPhoneCall: false, showVideoCall: false }}

tsx
components={{
  PhoneCallButton: ({ onPhoneCall, className }) => (
    <button className={className} onClick={onPhoneCall}>Call</button>
  ),
  VideoCallButton: ({ onVideoCall, className }) => (
    <button className={className} onClick={onVideoCall}>Video</button>
  ),
}}
PreviousThemes & localeNextIn-call control bar

On this page

OverviewOption A — Keep default buttons, add your own callbacksOption B — Replace the entire call button groupOption C — Replace individual call buttons