ChatBubble
A single chat message bubble with avatar, sender name, and timestamp.
Basic usage
A
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.
A
Y
A
Y
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.
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.
J
M
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
| Prop | Type | Default | Description |
|---|---|---|---|
message | string | required | The message text to display |
sender | string | undefined | Sender name shown above the bubble |
timestamp | string | undefined | Time/date string shown next to sender name |
position | 'left' | 'right' | 'left' | Which side the bubble appears on |
avatarSrc | string | undefined | URL for the avatar image |
avatarInitials | string | undefined | Fallback initials when no image is provided |