Skip to main content

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. This is the multi-attachment replacement for CometChatFileBubble. The message list always renders it for file messages in v7. The legacy CometChatFileBubble remains available as a deprecated standalone component you can use directly, but the list no longer uses it. 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 position awareness — adjusts corner radius based on position within a multi-message batch group
  • Caption support — optional caption rendered below the cards
Live Preview — interact with the files 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


Batch Position

When multiple media messages are sent together (sharing the same batchId), each message receives a batchPosition that controls its visual grouping: The batchPosition is computed automatically by the message list. You only need to pass it when using the bubble standalone outside of CometChatMessageList.

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).

batchPosition

Position within a multi-attachment batch group. Controls corner-radius styling.

className

Additional CSS class applied to the root element.

CSS Selectors


Relationship to Legacy File Bubble


Next Steps

File Bubble (Legacy)

Single-attachment file bubble

Images Bubble

Multi-attachment image bubble with grid layouts

Message List

Configure multi-attachment rendering

Message Composer

Enable multi-attachment staging tray