Skip to main content

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.

Minimal Render

Root CSS class: .cometchat-call-logs

Filtering Call Logs

Pass a CallLogRequestBuilder from @cometchat/calls-sdk-javascript to callLogRequestBuilder.

Filter Recipes

Refer to CallLogRequestBuilder for the full builder API.

Actions and Events

Callback Props

onItemClick

Fires when a call log entry is tapped.

onCallButtonClicked

Fires when the call-back button in the trailing view is tapped.

onError

Fires on internal errors (network failure, auth issue, SDK exception).

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.

itemView

Replace the entire call log list item.

subtitleView

Replace the subtitle text (call type, duration).

trailingView

Replace the right section (call-back button area).

callInitiatedDateTimeFormat

Customize the call initiated timestamp format using a CalendarObject.
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

Filtered to video calls only


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

Customization Matrix


Props

All props are optional.

activeCall

Highlights the currently active/selected call log entry.

callInitiatedDateTimeFormat

Format for displaying the call initiated timestamp. Falls back to global calendar configuration if not set.

callLogRequestBuilder

Controls which call logs load and in what order.

emptyView

Custom component displayed when there are no call logs.

errorView

Custom component displayed when an error occurs.

itemView

Custom renderer for the entire call log list item.

leadingView

Custom renderer for the avatar / left section.

loadingView

Custom component displayed during the loading state.

onCallButtonClicked

Callback fired when the call-back button is clicked.

onError

Callback fired when the component encounters an error.

onItemClick

Callback fired when a call log entry is clicked.

showScrollbar

Shows the scrollbar in the call log list.

subtitleView

Custom renderer for the subtitle text.

titleView

Custom renderer for the name / title text.

trailingView

Custom renderer for the right section.

Events


CSS Selectors