AI Integration Quick Reference
AI Integration Quick Reference

What You’re Building
Three sections working together:- Sidebar (conversation list) — shows all active conversations (users and groups)
- Message view — displays chat messages for the selected conversation in real time
- Message composer — text input with support for media, emojis, and reactions
Step 1 — Update the Root Component
Wire the conversation list and message components together in your root component. The UIKit’sChatStateService handles all the wiring — when a user clicks a conversation, cometchat-conversations updates the service, and the message components automatically react to the change.
Angular 20+ names the root component
App in src/app/app.ts, as below. A project created with Angular 17–19 uses AppComponent in src/app/app.component.ts — use that file and class name instead.src/app/app.ts
body margin also pushes a 100dvh shell 16px past the viewport, so the page scrolls slightly. Reset it in your global stylesheet (below the CometChat @import if you chose that option in Step 5 of Integration):
src/styles.css
cometchat-conversationscallsChatStateService.setActiveConversation()automatically when a conversation is clicked.setActiveConversation()extracts theUserorGroupand sets it as the active entity, enforcing mutual exclusivity (setting a user clears the group, and vice versa).cometchat-message-header,cometchat-message-list, andcometchat-message-composerauto-subscribe toChatStateService— no[user]or[group]bindings needed.- The
@ifblock readschatStateService.activeUser()andchatStateService.activeGroup()signals to show the chat window or the empty state.
Step 2 — Run the Project
Next Steps
Theming
Customize colors, fonts, and styles to match your brand
Components Overview
Browse all prebuilt UI components
Angular Integration
Back to the main setup guide
Core Features
Chat features included out of the box