Overview
The CometChatCallLogs component displays a paginated, scrollable list of call history records for the logged-in user. Each call log entry shows the other party’s avatar and name, the call direction (incoming, outgoing, or missed), the call type (audio or video), and the timestamp. Users can initiate new calls directly from the list and view real-time call overlays for outgoing and ongoing calls. The component follows a Service-based Architecture where:- CallLogsService handles call log fetching, pagination, call initiation, call lifecycle listeners, and state management via Angular signals
- Component manages UI rendering, template overrides, and user interactions
- Templates allow extensive customization of all UI sections
Key Features
- Pagination: Automatic infinite-scroll pagination via
CallLogRequestBuilderfrom the CometChat Calls SDK - Call Initiation: Start audio or video calls directly from a call log entry’s trailing button
- Call Overlays: Built-in outgoing call screen and ongoing call screen overlays with automatic lifecycle management
- Template Overrides: Extensive
ng-templateprojection for item, leading, title, subtitle, trailing, loading, empty, and error views - Keyboard Accessibility: Full keyboard navigation with arrow keys, Enter, and Tab support (WCAG 2.1 Level AA compliant)
- Active Call Highlighting: Highlight a specific call log entry via the
activeCallinput - Custom Date Formatting: Configurable call timestamp formatting with
CalendarObjectsupport - Error Handling: Comprehensive error handling with custom error views and
onErrorcallback
Live Preview — default call logs preview.
Open in Storybook ↗
Keyboard Accessibility
CometChatCallLogs is fully keyboard accessible and meets WCAG 2.1 Level AA standards. All functionality can be accessed using only the keyboard.Keyboard Shortcuts
| Key | Action | Context |
|---|---|---|
Tab | Navigate between UI elements (header, list items, call buttons) | Global |
Shift + Tab | Navigate backwards | Global |
↓ (Down Arrow) | Focus next call log item | When list is focused |
↑ (Up Arrow) | Focus previous call log item | When list is focused |
Enter | Select/activate focused call log item | When call log item is focused |
Space | Activate focused call log item or call button | When item or button is focused |
M | Toggle context menu on focused item | When call log item is focused |
Accessibility Features
ARIA Attributes:role="list"on the paginated list containerrole="listitem"on each call log item viacometchat-list-itemaria-labelwith user name and call type (e.g., “John Doe, Video call”)aria-busyon the list container during loadingaria-live="polite"on loading and status indicatorsrole="button"on the trailing call type icon with descriptivearia-label(e.g., “Audio call John Doe”)role="alert"on the error state viewrole="status"on the empty state view
- Announces call log details (user name and call type) when focused
- Announces loading and error states via live regions
- Semantic HTML structure with proper heading hierarchy
- Visible focus indicators (2px outline) meeting WCAG contrast requirements
focus-visiblestyling on trailing call buttons withoutline-offset- Roving
tabindexon list items for efficient keyboard navigation - Trailing call buttons are independently focusable with
tabindex="0"
- ✅ 2.1.1 Keyboard (Level A) — All functionality available via keyboard
- ✅ 2.1.2 No Keyboard Trap (Level A) — Users can navigate away using keyboard
- ✅ 2.4.3 Focus Order (Level A) — Logical focus order through list items and call buttons
- ✅ 2.4.7 Focus Visible (Level AA) — Visible focus indicators on all interactive elements
- ✅ 4.1.2 Name, Role, Value (Level A) — Proper ARIA attributes on all elements
- Shimmer loading animations are disabled when
prefers-reduced-motion: reduceis active
Basic Usage
Simple Implementation
With Call Button Handler
callButtonClicked has no observers, clicking the trailing call button automatically initiates a call of the same type (audio/video) to the other party. When a handler is bound, the call log is emitted to the handler instead, giving you full control over call initiation.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
activeCall | any | null | The currently selected/active call log for highlighting. When set, the matching call log entry is visually highlighted in the list. |
callLogRequestBuilder | any | null | Custom CallLogRequestBuilder from CometChatCalls. When provided, overrides the default builder (limit 30, category “call”). |
callInitiatedDateTimeFormat | CalendarObject | null | null | Custom date format for the call initiation timestamp. Merged with global and default CalendarObject formats (component-level wins). |
showScrollbar | boolean | false | Whether to show the scrollbar on the call logs list. |
callSettingsBuilder | CallSettingsBuilder | undefined | Custom CallSettingsBuilder to override the default call settings used in the ongoing call overlay. Follows the three-tier priority: @Input > GlobalConfig > default. |
onError | ((error: CometChat.CometChatException) => void) | null | null | Error callback invoked when any error occurs during operations such as fetching call logs or initiating calls. |
Template Properties
| Property | Type | Default | Description |
|---|---|---|---|
itemView | TemplateRef<any> | undefined | Custom template for each call log item (replaces the entire list item). |
leadingView | TemplateRef<any> | undefined | Custom template for the leading position (replaces the avatar). |
titleView | TemplateRef<any> | undefined | Custom template for the title (replaces the other party’s name). |
subtitleView | TemplateRef<any> | undefined | Custom template for the subtitle (replaces the direction icon and date). |
trailingView | TemplateRef<any> | undefined | Custom template for the trailing position (replaces the call button). |
menuView | TemplateRef<any> | undefined | Custom template for menu area in the header (e.g., action buttons, 3-dot menu). |
loadingView | TemplateRef<any> | undefined | Custom template for the loading state (replaces the default shimmer). |
emptyView | TemplateRef<any> | undefined | Custom template for the empty state when no call logs are available. |
errorView | TemplateRef<any> | undefined | Custom template for the error state when call log fetching fails. |
Events
| Event | Payload Type | Description |
|---|---|---|
itemClick | any (call log object) | Emitted when a call log list item is clicked. |
callButtonClicked | any (call log object) | Emitted when the trailing call button is clicked. When this event has no observers, clicking the button automatically initiates a call of the same type (audio/video) to the other party. |
Advanced Usage
Custom CallLogRequestBuilder
Use thecallLogRequestBuilder input to customize how call logs are fetched. The builder comes from CometChatCalls (the Calls SDK), not the core Chat SDK:
CallLogRequestBuilder Methods
| Method | Type | Description |
|---|---|---|
setLimit | number | Sets the number of call logs fetched per page (default: 30) |
setCallCategory | string | Filters by call category (e.g., 'call') |
setCallType | string | Filters by call type ('audio' or 'video') |
setAuthToken | string | Sets the authentication token for the request |
Custom Date Formatting
Override the default call timestamp format usingcallInitiatedDateTimeFormat:
Handling Call Button Events
By default, clicking the trailing call button automatically initiates a call of the same type (audio/video) to the other party. BindcallButtonClicked to override this behavior:
Active Call Highlighting
Highlight a specific call log entry by passing it to theactiveCall input:
Custom Call Settings
Override the defaultCallSettingsBuilder used in the ongoing call overlay when a call is initiated from the call logs:
Customization with Templates
Custom Subtitle View
Customize the subtitle section to show additional call details:Custom Trailing View
Replace the default call button with custom action buttons:Custom Empty and Error States
Provide custom views for empty and error states:Styling with CSS Variables
The CometChatCallLogs component uses CSS variables for comprehensive theming:Dark Theme Example
Custom Brand Colors
Error Handling
Built-in Error Handling
The component includes comprehensive error handling through theonError callback and built-in error state view:
Error Flow
Errors are handled at two levels:- Service level:
CallLogsServicecatches errors during fetch and call initiation, wraps them inCometChat.CometChatException, and forwards to theonErrorcallback - Component level: The component catches errors in event handlers and delegates to the same error handling pipeline
errorView template).
For troubleshooting tips, see the Troubleshooting Guide.
Related Components
- CometChatOutgoingCall: Outgoing call overlay displayed when a call is initiated from the call logs
- CometChatOngoingCall: Ongoing call screen displayed when an outgoing call is accepted
- CometChatCallButtons: Standalone call buttons component for initiating audio/video calls
- CometChatAvatar: Avatar component used in call log items
- CometChatListItem: List item component used for rendering each call log entry
- CometChatDate: Date component used for formatting call timestamps
- CometChatPaginatedList: Paginated list component providing infinite scroll
Technical Details
- Standalone Component: Can be imported and used independently
- Change Detection: Uses
OnPushstrategy for optimal performance - Service Architecture:
CallLogsServicehandles all business logic (fetching, pagination, call initiation, call lifecycle) - Signal-based State: Uses Angular signals for reactive state management
- Pagination: Automatic infinite scroll via
CometChatPaginatedListwith intersection observers - Call Lifecycle: Manages outgoing call → accepted → ongoing call → ended flow with overlays
- Accessibility: WCAG 2.1 Level AA compliant with full keyboard navigation
- BEM CSS: Follows Block Element Modifier naming convention
- Reduced Motion: Respects
prefers-reduced-motionmedia query for shimmer animations