AI Integration Quick Reference
AI Integration Quick Reference
Overview
CometChatFilesBubble renders generic file attachment(s) as stacked file cards. It is self-extracting: pass the SDK message and the bubble derives the file attachments and caption itself. The message list uses it automatically for file messages.
Key capabilities:
- Stacked file cards — one card per file with type icon, filename, extension label, and file size
- File-type icons — recognizes PDF, Word, Excel, PowerPoint, text, zip, audio, video, and image extensions
- Collapsible list — shows up to 3 files initially, with a “+N more” toggle to expand
- Download button — download individual files
- Batch grouping — rendered as one connected group when several media messages are sent together (handled by the message list)
- Caption support — optional caption rendered below the cards
Live Preview — interact with the file bubble.Open in Storybook ↗
Usage
File Card Layout
Each attachment renders as a card with:
When a message has more than 3 file attachments, the list is initially collapsed with a toggle showing “+N more”. Clicking the toggle expands to show all files.
Supported File-Type Icons
Props
message
The file message. The bubble extracts its attachments and caption from it. Required.alignment
Override incoming/outgoing alignment. Defaults to sender-vs-logged-in-user.textFormatters
Text formatters applied to the caption (mentions, URLs).className
Additional CSS class applied to the root element.CSS Selectors
Next Steps
Image Bubble
Batch-aware image bubble with grid layouts
Audio Bubble
Batch-aware audio bubble with player cards
Message List
Multi-attachment batch grouping in the list
Message Composer
Multi-attachment staging tray