Display
Message Bubble
A chat bubble with direction, grouping tails, sender and avatar, reply quote, reactions and delivery ticks.
<script>
import { MessageBubble } from "@codeatlasdev/ui";
</script>
<MessageBubble direction="out" time="14:32" status="delivered">Sent it by email.</MessageBubble>
direction picks the side and colors (out uses the brand fill). Consecutive messages from one person use grouped: first, middle and last flatten the joined corners, and only single and last keep the tail and show the avatar slot (the other positions reserve its width so the column stays aligned). The delivery ticks are decorative; the state is also written as visually hidden text after the time, so a screen reader hears “14:32, Delivered” once. The bubble has no live region: the list that appends messages decides what is announced.
A grouped conversation
The first bubble shows the sender, the last one the avatar and the tail.
Reference #248 · Pick in the gallery
Code
Delivery status
pending, sent, delivered and read; read ticks use the info color.
Reference #249 · Pick in the gallery
Code
Quote and reactions
The quote slot renders a reply preview; reactions overlap the bottom edge.
Reference #250 · Pick in the gallery
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
direction | 'in' | 'out' | 'in' | Side and color. |
grouped | 'single' | 'first' | 'middle' | 'last' | 'single' | Position in a run of bubbles from one sender; controls the tail and spacing. |
sender | string | – | Name above the text, for incoming single or first bubbles. |
avatar | Snippet | – | Avatar slot beside incoming bubbles (single and last). |
quote | Snippet | – | Reply preview shown at the top of the bubble. |
reactions | { emoji: string; count?: number; mine?: boolean }[] | – | Reaction chips under the bubble. |
time | string | – | Footer time text. |
status | 'pending' | 'sent' | 'delivered' | 'read' | – | Delivery ticks for outgoing bubbles. |
footer | Snippet | – | Extra footer content before the time. |
children | Snippet | – | Message body. |