Bubble
The surface half of a chat message — the fill, the corner and the reaction pill a single line of conversation gets.
Bubble
The surface half of the chat family — the fill, the corner and the reaction pill. `Message` owns the layout around it, and the two are coupled: a bubble emits `data-variant`, which the message's header and footer read to drop their padding for a ghost.
Usage
import {
Bubble,
BubbleContent,
BubbleGroup,
BubbleReactions,
} from '@oceanic-hub/brand-system'<BubbleGroup>
<Bubble>
<BubbleContent>…</BubbleContent>
<BubbleReactions>…</BubbleReactions>
</Bubble>
</BubbleGroup>Composition
Use the following composition to build a Bubble:
BubbleGroup
└── Bubble ×5
├── BubbleContent
└── BubbleReactionsBubble is SURFACE, Message is LAYOUT, and the split matters: this component owns
what a line of conversation looks like, Message owns where it sits — the avatar column, the
sender's name, the timestamp rail. Building a thread reaches for both; Bubble alone is what
you use inside something that is already laying out the row. Neither this nor Message is the
scroll container — a thread that grows while it is on screen lives inside a MessageScroller.
The two are mechanically coupled, not just conventionally paired: Bubble emits
data-variant, which Message's header and footer read to drop their own padding for a
ghost bubble; Message emits data-align on its group, which Bubble reads to hang
itself off the correct edge. Deleting either attribute breaks the OTHER component's CSS,
silently, on a green build — read message's own note alongside this one.
Every variant stays reachable, refused colours and all. Upstream's table is short and
wrong in four separate ways once measured against this package's roles — relative-colour
arithmetic where accent-tint / brand-soft already name the two steps it was computing,
destructive written as coloured text at 1.7–1.9:1 contrast, secondary/muted on
unaliased fills that would paint nothing, a translucent focus ring where a solid
focus-visible:border-brand belongs. Put plainly: upstream computes tinted with
oklch(from var(--primary) …) arithmetic and paints destructive as red text on a red
tint, and both are refused — the tints are the accent-tint and brand-soft roles, and a
status tone is a fill with the label in status-ink, never text. Each is a decision, not a
silence — every line of core-layer.md that excludes one is cited in
bubble.contract.test-d.ts. Dropping a variant because its upstream colours were wrong
would have been the actual parity failure: the rule this package ports against is a floor,
not a mould.
align is usually inherited from the enclosing Message; set it directly only for a bubble
that stands outside one. There is no center — a bubble hangs off an edge by definition, and a
centred row (a date divider, an unread rule) is a Marker, a different component with a
different job.
Tooltip and Popover, upstream's last two examples, are not shipped here. Both are pure
compositions of Tooltip and Popover wrapping arbitrary children — nothing about wrapping
one in a Bubble is Bubble-specific, so a demo here would repeat those components' own
pages rather than teach anything new.
Secondary
The other side of a two-party thread — a question back, not the surface that owns the row.
Muted
A step quieter than the surface it sits in — the assistant's own working note, not a reply that expects an answer.
Tinted
A step warmer than secondary — reach for it on a suggested next step, something the reader is invited to act on rather than merely told.
Outline
A hairline and no fill — a saved draft, present but not yet committed to the thread's history.
Ghost
No fill, no corner, no padding — a bubble that is only its words.
Destructive
A delivery failure — the one tone with a genuine incident behind it, never a decoration.
Alignment
align hangs a bubble off its own edge when it stands outside a Message — normally it is inherited from the enclosing message instead. start is incoming, end is the reader's own; there is no center, because a bubble hangs off an edge by definition.
Links and buttons
asChild lives on BubbleContent, not on Bubble's root, so the hover and focus rules only light up when the content genuinely is a control — a retry tap target or a link preview, not a bubble of plain text.
Reactions
side picks which edge the pill straddles, align which end of that edge it sits at — bottom / end is the default, the corner a reply usually lands nearest. The pill is a hard, offsetless ring that punches its own cut-out in the bubble underneath, never a blurred one.
Show more
Long content is a composition, not a Bubble prop: wrap the tail of a message in Collapsible and let its own trigger do the work. Bubble stays exactly what it always is — the fill and the corner — and does not grow a truncation feature of its own.
API Reference
See the Bubble API page for every prop of every part, with types, defaults and the contract that pins them. It also documents bubbleVariants — exported alongside the parts, and signatures rather than props.
Breadcrumb
The path down to this page, one link per level above it — a signpost for surfaces deep enough to get lost in, never the way to move between them.
Button
An action a reader takes, not a label they read — if it only names something that is a `Badge`, and if it navigates, compose it with `asChild`.