Skip to main content

Overview

CometChatImagesBubble renders the image attachment(s) of a media message with batch-aware styling. It is self-extracting: pass the SDK message and the bubble derives its attachments, caption, and alignment itself. The message list uses it automatically for image messages. Key capabilities:
  • Adaptive grid layouts — single image, 2-column, 2×2 grid, and overflow (+N) based on attachment count
  • Fullscreen gallery viewer — click any image to open a paginated fullscreen gallery
  • Batch grouping — rendered as one connected group when several media messages are sent together (handled by the message list)
  • Placeholder loading — shows a configurable placeholder while images load
Live Preview — interact with the image bubble.Open in Storybook ↗

Usage


Grid Layouts

The bubble automatically selects a layout based on the number of image attachments:

Props

message

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

placeholderImage

Custom placeholder image URL shown while the image is loading. Falls back to a default photo icon.

onImageClicked

Callback fired when an image tile is clicked (in addition to opening the fullscreen viewer).

className

Additional CSS class applied to the root element.

CSS Selectors


Next Steps

Video Bubble

Batch-aware video bubble with grid layouts

File Bubble

Batch-aware file bubble with stacked cards

Message List

Multi-attachment batch grouping in the list

Message Composer

Multi-attachment staging tray