Skip to main content
{
  "component": "CometChatCallLogs",
  "package": "@cometchat/chat-uikit-react",
  "import": "import { CometChatCallLogs } from \"@cometchat/chat-uikit-react\";",
  "cssImport": "import \"@cometchat/chat-uikit-react/css-variables.css\";",
  "description": "Scrollable list of call history entries with filtering, call-back actions, and custom views.",
  "cssRootClass": ".cometchat-call-logs",
  "primaryOutput": {
    "prop": "onItemClick",
    "type": "(call: any) => void"
  },
  "props": {
    "data": {
      "callLogRequestBuilder": {
        "type": "any (CallLogRequestBuilder)",
        "default": "SDK default (30 per page)"
      },
      "activeCall": {
        "type": "any",
        "default": "undefined"
      },
      "callInitiatedDateTimeFormat": {
        "type": "CalendarObject",
        "default": "DD MMM, hh:mm A"
      }
    },
    "callbacks": {
      "onItemClick": "(call: any) => void",
      "onCallButtonClicked": "(call: any) => void",
      "onError": "((error: CometChat.CometChatException) => void) | null"
    },
    "visibility": {
      "showScrollbar": { "type": "boolean", "default": false }
    },
    "viewSlots": {
      "itemView": "(call: any) => JSX.Element",
      "leadingView": "(call: any) => JSX.Element",
      "titleView": "(call: any) => JSX.Element",
      "subtitleView": "(call: any) => JSX.Element",
      "trailingView": "(call: any) => JSX.Element",
      "loadingView": "JSX.Element",
      "emptyView": "JSX.Element",
      "errorView": "JSX.Element"
    }
  },
  "events": [
    {
      "name": "CometChatMessageEvents.ccMessageSent",
      "payload": "IMessages",
      "description": "Call message sent"
    }
  ],
  "types": {
    "CalendarObject": {
      "today": "string | undefined",
      "yesterday": "string | undefined",
      "lastWeek": "string | undefined",
      "otherDays": "string | undefined"
    }
  }
}

Where It Fits

CometChatCallLogs is a standalone list component that renders call history entries. Each entry shows the caller/callee, call type (audio/video), direction (incoming/outgoing/missed), and timestamp. The onItemClick callback emits the selected call log, and onCallButtonClicked fires when the call-back button is tapped.
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";
import "@cometchat/chat-uikit-react/css-variables.css";

function CallLogPanel() {
  return (
    <div style={{ width: 480, height: "100vh" }}>
      <CometChatCallLogs
        onItemClick={(callLog: any) => {
          console.log("Call log selected:", callLog);
        }}
        onCallButtonClicked={(callLog: any) => {
          console.log("Call back:", callLog);
        }}
      />
    </div>
  );
}

Minimal Render

import { CometChatCallLogs } from "@cometchat/chat-uikit-react";
import "@cometchat/chat-uikit-react/css-variables.css";

function CallLogsDemo() {
  return (
    <div style={{ width: "100%", height: "100%" }}>
      <CometChatCallLogs />
    </div>
  );
}

export default CallLogsDemo;
Root CSS class: .cometchat-call-logs

Filtering Call Logs

Pass a CallLogRequestBuilder from @cometchat/calls-sdk-javascript to callLogRequestBuilder.
import { CallLogRequestBuilder } from "@cometchat/calls-sdk-javascript";
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function FilteredCallLogs() {
  return (
    <CometChatCallLogs
      callLogRequestBuilder={
        new CallLogRequestBuilder()
          .setAuthToken("AUTH_TOKEN")
          .setLimit(10)
          .setCallStatus("cancelled")
      }
    />
  );
}

Filter Recipes

RecipeCode
Limit to 5 per pagenew CallLogRequestBuilder().setAuthToken(token).setLimit(5)
Cancelled calls onlynew CallLogRequestBuilder().setAuthToken(token).setCallStatus("cancelled")
Video calls onlynew CallLogRequestBuilder().setAuthToken(token).setCallType("video")
Calls with recordingsnew CallLogRequestBuilder().setAuthToken(token).setHasRecording(true)
Calls for a specific usernew CallLogRequestBuilder().setAuthToken(token).setUid("user_uid")
Calls for a specific groupnew CallLogRequestBuilder().setAuthToken(token).setGuid("group_guid")
Refer to CallLogRequestBuilder for the full builder API.

Actions and Events

Callback Props

onItemClick

Fires when a call log entry is tapped.
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function CallLogsWithClick() {
  return (
    <CometChatCallLogs
      onItemClick={(callLog: any) => {
        console.log("Selected call log:", callLog);
      }}
    />
  );
}

onCallButtonClicked

Fires when the call-back button in the trailing view is tapped.
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function CallLogsWithCallback() {
  return (
    <CometChatCallLogs
      onCallButtonClicked={(callLog: any) => {
        console.log("Call back:", callLog);
      }}
    />
  );
}

onError

Fires on internal errors (network failure, auth issue, SDK exception).
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";
import { CometChat } from "@cometchat/chat-sdk-javascript";

function CallLogsWithError() {
  return (
    <CometChatCallLogs
      onError={(error: CometChat.CometChatException) => {
        console.error("CometChatCallLogs error:", error);
      }}
    />
  );
}

Global UI Events

The component subscribes to CometChatMessageEvents.ccMessageSent to detect when a call message is sent and refresh the list.

SDK Events (Real-Time, Automatic)

The component listens to SDK call events internally for real-time updates. No manual attachment needed.
In React 18 StrictMode, useEffect runs twice on mount in development. The component handles listener cleanup internally.

Custom View Slots

Each slot replaces a section of the default UI. Slots that accept a call log parameter receive the call log object for that row.
SlotSignatureReplaces
itemView(call: any) => JSX.ElementEntire list item row
leadingView(call: any) => JSX.ElementAvatar / left section
titleView(call: any) => JSX.ElementName / title text
subtitleView(call: any) => JSX.ElementCall type, direction, timestamp
trailingView(call: any) => JSX.ElementCall-back button area
loadingViewJSX.ElementLoading spinner
emptyViewJSX.ElementEmpty state
errorViewJSX.ElementError state

itemView

Replace the entire call log list item.
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function CustomItemViewCallLogs() {
  const getItemView = (callLog: any) => {
    return (
      <div className="custom-call-log-item">
        <div className="custom-call-log-item__name">
          {callLog?.getInitiator()?.getName()}
        </div>
        <div className="custom-call-log-item__status">
          {callLog?.getStatus()}
        </div>
      </div>
    );
  };

  return <CometChatCallLogs itemView={getItemView} />;
}

subtitleView

Replace the subtitle text (call type, duration).
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function SubtitleCallLogs() {
  const getSubtitleView = (callLog: any) => {
    return (
      <div className="custom-call-log-subtitle">
        {callLog?.getStatus()}{callLog?.getType()}
      </div>
    );
  };

  return <CometChatCallLogs subtitleView={getSubtitleView} />;
}

trailingView

Replace the right section (call-back button area).
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function TrailingViewCallLogs() {
  const getTrailingView = (callLog: any) => {
    return (
      <div className="custom-call-log-trailing">
        <button onClick={() => console.log("Call back", callLog)}>
          Call Back
        </button>
      </div>
    );
  };

  return <CometChatCallLogs trailingView={getTrailingView} />;
}

callInitiatedDateTimeFormat

Customize the call initiated timestamp format using a CalendarObject.
import {
  CometChatCallLogs,
  CalendarObject,
} from "@cometchat/chat-uikit-react";

function CustomDateCallLogs() {
  const dateFormat = new CalendarObject({
    today: "hh:mm A",
    yesterday: "[yesterday]",
    otherDays: "DD MM YYYY",
  });

  return <CometChatCallLogs callInitiatedDateTimeFormat={dateFormat} />;
}
If no property is passed in the CalendarObject, the component checks the global configuration first. If also missing there, the component’s default formatting applies.

Common Patterns

Custom empty state

import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function EmptyStateCallLogs() {
  return (
    <CometChatCallLogs
      emptyView={
        <div style={{ textAlign: "center", padding: 40 }}>
          <p>No call history</p>
        </div>
      }
    />
  );
}

Filtered to video calls only

import { CallLogRequestBuilder } from "@cometchat/calls-sdk-javascript";
import { CometChatCallLogs } from "@cometchat/chat-uikit-react";

function VideoCallLogs({ authToken }: { authToken: string }) {
  return (
    <CometChatCallLogs
      callLogRequestBuilder={
        new CallLogRequestBuilder()
          .setAuthToken(authToken)
          .setCallType("video")
      }
    />
  );
}

CSS Architecture

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

Key Selectors

TargetSelector
Root.cometchat-call-logs
List item.cometchat-call-logs .cometchat-list-item
Active item.cometchat-call-logs__list-item-active .cometchat-list-item
Trailing view (video).cometchat-call-logs__list-item-trailing-view-video
Trailing view (audio).cometchat-call-logs__list-item-trailing-view-audio
Subtitle.cometchat-call-logs__list-item-subtitle
Subtitle date.cometchat-call-logs__list-item-subtitle .cometchat-date
Missed call icon.cometchat-call-logs__list-item-subtitle-icon-missed-call
Outgoing call icon.cometchat-call-logs__list-item-subtitle-icon-outgoing-call
Incoming call icon.cometchat-call-logs__list-item-subtitle-icon-incoming-call
Empty state.cometchat-call-logs__empty-state-view
Error state.cometchat-call-logs__error-state-view
Shimmer loading.cometchat-call-logs__shimmer
Outgoing call overlay.cometchat-call-logs__outgoing-call

Customization Matrix

What to changeWhereProperty/APIExample
Override behavior on user interactionComponent propson<Event> callbacksonItemClick={(c) => showDetails(c)}
Filter which call logs appearComponent propscallLogRequestBuildercallLogRequestBuilder={new CallLogRequestBuilder().setLimit(5)}
Replace a section of the list itemComponent props<slot>View render propssubtitleView={(c) => <div>{c.getStatus()}</div>}
Change colors, fonts, spacingGlobal CSSTarget .cometchat-call-logs class.cometchat-call-logs .cometchat-list-item { background: #f9f8fd; }

Accessibility

The component renders a scrollable list of interactive items. Each call log row is keyboard-focusable and activates on Enter/Space. Call direction icons (incoming/outgoing/missed) use CSS mask images — add aria-label attributes via itemView if screen reader descriptions are needed.

Props

All props are optional.

activeCall

Highlights the currently active/selected call log entry.
Typeany
Defaultundefined

callInitiatedDateTimeFormat

Format for displaying the call initiated timestamp.
TypeCalendarObject
DefaultComponent default (DD MMM, hh:mm A)
Falls back to global calendar configuration if not set.

callLogRequestBuilder

Controls which call logs load and in what order.
Typeany (CallLogRequestBuilder from @cometchat/calls-sdk-javascript)
DefaultSDK default (30 per page)

emptyView

Custom component displayed when there are no call logs.
TypeJSX.Element
DefaultBuilt-in empty state

errorView

Custom component displayed when an error occurs.
TypeJSX.Element
DefaultBuilt-in error state

itemView

Custom renderer for the entire call log list item.
Type(call: any) => JSX.Element
DefaultBuilt-in list item

leadingView

Custom renderer for the avatar / left section.
Type(call: any) => JSX.Element
DefaultBuilt-in avatar

loadingView

Custom component displayed during the loading state.
TypeJSX.Element
DefaultBuilt-in shimmer

onCallButtonClicked

Callback fired when the call-back button is clicked.
Type(call: any) => void
Defaultundefined

onError

Callback fired when the component encounters an error.
Type((error: CometChat.CometChatException) => void) | null
Defaultundefined

onItemClick

Callback fired when a call log entry is clicked.
Type(call: any) => void
Defaultundefined

showScrollbar

Shows the scrollbar in the call log list.
Typeboolean
Defaultfalse

subtitleView

Custom renderer for the subtitle text.
Type(call: any) => JSX.Element
DefaultBuilt-in subtitle

titleView

Custom renderer for the name / title text.
Type(call: any) => JSX.Element
DefaultBuilt-in title

trailingView

Custom renderer for the right section.
Type(call: any) => JSX.Element
DefaultBuilt-in trailing view

Events

EventPayloadFires when
CometChatMessageEvents.ccMessageSentIMessagesCall message sent

CSS Selectors

TargetSelector
Root.cometchat-call-logs
List item.cometchat-call-logs .cometchat-list-item
Active item.cometchat-call-logs__list-item-active .cometchat-list-item
Trailing view (video).cometchat-call-logs__list-item-trailing-view-video
Trailing view (audio).cometchat-call-logs__list-item-trailing-view-audio
Subtitle.cometchat-call-logs__list-item-subtitle
Subtitle date.cometchat-call-logs__list-item-subtitle .cometchat-date
Missed call icon.cometchat-call-logs__list-item-subtitle-icon-missed-call
Outgoing call icon.cometchat-call-logs__list-item-subtitle-icon-outgoing-call
Incoming call icon.cometchat-call-logs__list-item-subtitle-icon-incoming-call
Empty state.cometchat-call-logs__empty-state-view
Error state.cometchat-call-logs__error-state-view
Shimmer loading.cometchat-call-logs__shimmer
Outgoing call overlay.cometchat-call-logs__outgoing-call