Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-react-uikit-v7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Package | @cometchat/chat-uikit-react |
| Framework | Astro |
| Components | CometChatConversations, CometChatCallLogs, CometChatUsers, CometChatMessageHeader, CometChatMessageList, CometChatMessageComposer |
| Layout | Tabbed sidebar (Chat, Calls, Users) + message view |
| Prerequisite | Complete Astro Integration first |
| SSR | React island with client:only="react" directive |
| Pattern | Full-featured messaging app with multiple sections |
What You’re Building
Three sections working together:- Tab bar — switches between Chat, Calls, and Users
- Sidebar — renders the list for the active tab
- Message view — header + messages + composer for the selected item
Full Code
Create a React island component with the tabbed UI, then render it in an Astro page withclient:only="react".
src/components/TabbedChat.tsx
src/pages/chat.astro
How It Works
client:only="react"tells Astro to skip server-rendering and hydrate the component entirely on the client. This is required because CometChat uses browser APIs.- React island — the CometChat UI lives in a self-contained React component. Astro handles the page shell, React handles the interactive chat.
- Tab state —
activeTabcontrols which list component renders in the sidebar. - Conditional rendering — only the active tab’s component mounts. Switching tabs unmounts the previous list and mounts the new one.
- Unified selection — all three tabs feed into the same
selectedUser/selectedGroupstate. Clicking any item (conversation, call log, or user) updates the message panel. - Call log handling — when a call log is clicked, the receiver (user or group) is extracted and passed to the message components.
Adding More Tabs
To add a Groups tab, importCometChatGroups and add another tab button + conditional render:
Run
http://localhost:4321/chat. You should see the tab bar at the top of the sidebar. Switch between Chats, Calls, and Users — clicking any item loads the message view on the right.
Next Steps
Conversation List + Messages
Two-panel layout without tabs
Components Overview
Browse all prebuilt UI components
Theming
Customize colors, fonts, and styles