Actions control component behavior. They split into two categories:Predefined Actions are built into the component and execute automatically on user interaction (e.g., clicking send dispatches the message). No configuration needed.User-Defined Actions are @Output() callbacks that fire on specific events. Override them to customize behavior:
Events enable decoupled communication between components. A component emits events that other parts of the application can subscribe to without direct references.
import { CometChatMessageEvents } from '@cometchat/chat-uikit-angular';import { Subscription } from 'rxjs';// Subscribe in ngOnInitthis.subscription = CometChatMessageEvents.ccMessageSent.subscribe((message) => { // react to sent message});// Cleanup in ngOnDestroythis.subscription?.unsubscribe();
Each component page documents its emitted events in the Events section. See Events for the full reference.
cometchat-message-list — scrollable message feed with reactions, receipts, and threads
cometchat-message-composer — rich text input with attachments, mentions, and voice notes
Data flow: selecting a conversation in cometchat-conversations yields a CometChat.User or CometChat.Group object. That object is passed as an input ([user] or [group]) to cometchat-message-header, cometchat-message-list, and cometchat-message-composer. The message components use the SDK internally — cometchat-message-composer sends messages, cometchat-message-list receives them via real-time listeners.The UIKit supports a Hybrid Approach for wiring components: by default, components subscribe to ChatStateService for active chat state, but explicit @Input() bindings always take priority. This lets you start with zero-config service-based wiring and override individual components as needed. See the State Management guide for a full comparison and code examples.Components communicate through a publish/subscribe event bus (CometChatMessageEvents, CometChatConversationEvents, CometChatGroupEvents, etc.). A component emits events that other components or application code can subscribe to without direct references. See Events for the full list.Each component accepts @Output() callbacks, ng-template view slot inputs for replacing UI sections, RequestBuilder inputs for data filtering, and CSS variable overrides on .cometchat-<component> classes.