4.2.0
Core

Message

One turn in a conversation: the avatar column, the name and timestamp rails, and which side of the thread it hangs off.

Message

Two turns of one conversation. `align` is the whole mirroring mechanism — `start` is what arrived, `end` is the reader's own — and setting it reverses the row, so the avatar swaps sides and the body follows it. The bubble takes its side from the row and does not need telling twice.

MR
The Q3 re-engagement list is ready. 1,204 contacts, deduped on work email.
JS
Hold it until the sending domain finishes warming. Thursday at the earliest.

Usage

import {
  Message,
  MessageAvatar,
  MessageContent,
  MessageFooter,
  MessageGroup,
  MessageHeader,
} from '@oceanic-hub/brand-system'
<MessageGroup>
  <Message>
    <MessageAvatar>…</MessageAvatar>
    <MessageContent>…</MessageContent>
  </Message>
</MessageGroup>

Composition

Use the following composition to build a Message:

MessageGroup
└── Message ×3
    ├── MessageAvatar
    └── MessageContent
        ├── MessageHeader
        └── MessageFooter

Message is LAYOUT and Bubble is SURFACE — this component decides where a line of conversation sits, Bubble decides what it looks like. Reach for both to build a thread; reach for Bubble alone inside something that already lays the row out. Neither is the scroll container: a conversation that grows while a reader is looking at it belongs in a MessageScroller, which is the shell these two live in.

The two are mechanically coupled, in both directions and by CSS rather than by convention. Message emits data-align on its row, which Bubble reads to hang itself off the correct edge; MessageHeader and MessageFooter reach back the other way and read Bubble's data-variant, so a ghost bubble — which has no padding — pulls both rails flush instead of leaving the sender's name 12px right of their own words. Either attribute removed breaks the OTHER component, silently, on a green build. Read bubble's note alongside this one.

align is set once, on the row, and never repeated on the parts inside: they all pick it up through the group. There is no third value — a centred row in a thread is a date divider or an unread rule, which is a Marker, not a message with a different alignment.

MessageAvatar is a well, not a second avatar component. Put this package's Avatar inside it and let the well own the geometry — including the offset that lifts the portrait back onto the last line of the body when a footer is present. Left empty it is a spacer exactly one Avatar wide and no taller, which is how consecutive turns from one sender keep their column.

Upstream's page is a true counterpart, not a nearest relative: it ships from the same registry as the rest of shadcn (no separate package, unlike message-scroller) and documents the same exports under the same names, so all five of its examples are here. The one thing translated rather than copied is the attachment, which upstream nests inside the bubble; the chip in this package carries its own surface and border, so it sits beside the bubble instead.

MessageHeader is a sender's name, so it stays in Figtree; MessageFooter is a timestamp and a delivery receipt, so it is DM Mono with tabular-nums and a column of times will not shimmer as the minutes tick. Add a footer and the portrait lifts back onto the last line of the body — without one the avatar would sit level with the clock instead of with the words.

MR
Marta Ruiz
I have paused the Thursday send until the domain clears.
09:41
JS
You
Good. I will re-check the SPF record this afternoon.
09:43 · read

Consecutive turns

When one sender writes twice in a row, the name and the portrait belong on the first line only. Leave an empty MessageAvatar on the rest rather than dropping it: it is min-w-8, the width of an Avatar, and it has no height of its own, so the column stays true without repeating the face.

MR
Marta Ruiz
The import finished — 1,204 rows in, 3 skipped.
Two were missing a work email and one duplicated a contact already here.
Re-running just those three now.

Actions

The footer is a rail, not just a clock: copy, retry and a delivery state all sit on it. Keep the controls ghost at icon-sm so they clear the 32px touch floor without out-weighing the words above them, and give each one an aria-label — an icon button inside a thread has no column header to borrow its meaning from.

Schedule the Q3 re-engagement send for Thursday at 09:00.
Not delivered

Attachment

A file rides with the words rather than replacing them: give Attachment its own place inside MessageContent, beside the bubble, and it inherits the row's alignment while keeping its own width. Upstream nests the file inside the bubble; here the chip already carries a surface and a border, so nesting it would draw two boxes around one thing.

MR
Marta Ruiz
Here is the list I ran it against — the skipped rows are on tab 2.
q3-reengagement.csv1,204 rows · 84 KB
09:47

System turns

A ghost bubble is the line the product speaks rather than a person: no fill, no corner, no padding. Its header and footer read the bubble's variant back through the row and drop their own rail to match, so the note lines up with its own words — compare it with the human turn above, whose rails are inset by the bubble's padding.

MR
Marta Ruiz
Go ahead and book it for Thursday.
09:44
AC
Agent console
Scheduled the campaign for Thursday 09:00 and cleared the warm-up alert.
09:44 · automated

API Reference

See the Message API page for every prop of every part, with types, defaults and the contract that pins them.

On this page