This page as markdown: /message.md · Index for agents: /llms.txt · Everything in one file: /llms-full.txt

Message

Status: stable

One row in a conversation: avatar gutter, side, and stacked header / content / footer. Layout only — the surface is Bubble, passed as children.

Keywords: chat, message, conversation row, turn, thread, messaging, grouped messages, ai chat

Usage

The row a single turn occupies. It owns the geometry — which side, the avatar gutter, where the name and timestamp go, where reactions and receipts go — and nothing about how the content looks. That separation is the point: an assistant's markdown answer, a one-line reply, an attachment, and a tool-call card are all the same row with different children.

Best practices

Anatomy

Part Required Description
Avatar gutter no Fixed-width column for the author's Avatar. Kept (but emptied) when grouped, which is what keeps a run aligned.
Header no Author name and timestamp, above the content.
Content yes The children — usually a Bubble, but equally an Attachment, a tool card, or plain rendered markdown.
Footer no Reactions, delivery receipts, retry actions.

Props

Name Type Default Description
messageId string — Stable id, published as data-message-id. The handle MessageScroller uses for scroll commands and visibility tracking.
align "start" | "end" "start" Which side of the conversation. "start" is the other party or the assistant; "end" is the person reading. Mirrors the whole row, gutter included.
avatar ReactNode — Avatar node for the gutter. Omit for a message with no author identity.
avatarSize "sm" | "md" | "lg" "sm" Gutter width, matching Avatar's own size scale 1:1 (32 / 40 / 48px). Declared rather than measured so it survives grouped.
header ReactNode — Author name, timestamp — anything above the content.
footer ReactNode — Reactions, receipts, retry actions — anything below the content.
grouped boolean false This message continues a run from the same author: tightens the spacing (via --message-gap) and drops the avatar while reserving its column.
...div props Omit<ComponentPropsWithRef<"div">, "id"> — Spread onto the row. Use messageId rather than id — the scroller matches on data-message-id.

Variants

Tokens used

foreground, muted-foreground

Accessibility

Related

Examples

Incoming and outgoing

import { Avatar, Bubble, Message, RelativeTime } from "@sableui/react"

<>
	<Message messageId="m1" avatar={<Avatar size="sm" fallback="CA" />} header={<><strong className="text-foreground">Carla</strong><RelativeTime date={sentAt} /></>}>
		<Bubble>Did the deploy finish?</Bubble>
	</Message>
	<Message messageId="m2" align="end">
		<Bubble variant="primary" align="end">Green across the board.</Bubble>
	</Message>
</>

A grouped run

import { Avatar, Bubble, Message } from "@sableui/react"

<>
	<Message messageId="m1" avatar={<Avatar size="sm" fallback="CA" />} header={<strong className="text-foreground">Carla</strong>}>
		<Bubble>One more thing.</Bubble>
	</Message>
	<Message messageId="m2" grouped>
		<Bubble tail={false}>The staging cert expires Friday.</Bubble>
	</Message>
</>

With reactions in the footer

import { Avatar, Bubble, BubbleReaction, BubbleReactions, Message } from "@sableui/react"

<Message messageId="m3" avatar={<Avatar size="sm" fallback="JR" />} footer={<BubbleReactions><BubbleReaction emoji="🎉" count={3} active /><BubbleReaction emoji="👀" /></BubbleReactions>}>
	<Bubble>Shipped 0.45.0.</Bubble>
</Message>

An attachment as the content

import { Attachment, Message } from "@sableui/react"

<Message messageId="m4" align="end">
	<Attachment name="proposal.pdf" meta="2.4 MB · PDF" />
</Message>