Skip to content

ChatBubble

A single chat message bubble with avatar, sender name, and timestamp.

Basic usage

Tailwind v4
vue
<ChatBubble
  message="Hey there! How's the project going?"
  sender="Alice"
  timestamp="10:32 AM"
  avatarInitials="A"
/>

Left and right positions

Use position="right" for messages sent by the current user.

Tailwind v4
vue
<ChatBubble
  message="Hey there! How's the project going?"
  sender="Alice"
  timestamp="10:32 AM"
  avatarInitials="A"
  position="left"
/>
<ChatBubble
  message="Pretty good! Just finished the API integration."
  sender="You"
  timestamp="10:33 AM"
  avatarInitials="Y"
  position="right"
/>
<ChatBubble
  message="That's great news. Can you send over the docs?"
  sender="Alice"
  timestamp="10:34 AM"
  avatarInitials="A"
  position="left"
/>
<ChatBubble
  message="Sure! Sending now."
  sender="You"
  timestamp="10:34 AM"
  avatarInitials="Y"
  position="right"
/>

With avatar image

Pass avatarSrc to show a profile photo instead of initials.

Tailwind v4
vue
<ChatBubble
  message="I've reviewed the pull request and left some comments."
  sender="Taylor"
  timestamp="2:15 PM"
  avatarSrc="https://i.pravatar.cc/64?img=3"
  position="left"
/>

Minimal (no metadata)

Omit sender and timestamp for a minimal bubble with no header.

Tailwind v4
vue
<ChatBubble message="Can you help me with this?" avatarInitials="J" position="left" />
<ChatBubble message="Of course! What do you need?" avatarInitials="M" position="right" />

Props

PropTypeDefaultDescription
messagestringrequiredThe message text to display
senderstringundefinedSender name shown above the bubble
timestampstringundefinedTime/date string shown next to sender name
position'left' | 'right''left'Which side the bubble appears on
avatarSrcstringundefinedURL for the avatar image
avatarInitialsstringundefinedFallback initials when no image is provided

Private — Jetpack Labs internal use only