Message

Displays a message in a conversation, with optional avatar, header, footer, and alignment.

Deploying to prod real quick.
JB
It's 4:55 PM. On a Friday.
It's a one-line change.
Delivered
JB
It's always a one-line change 😭.
Alright, let me take a look.
👍
Alvish is typing…

The Message component lays out a single message in a conversation. It handles the avatar, alignment, header, and footer around the message surface.

For AI apps, you can render reasoning steps, tool calls and assistant messages using the Message component.

Installation

import {
  Message,
  MessageGroup,
} from "@o/pipeline/experimental/components/chat/message";

Usage

import { Avatar } from "@o/pipeline/experimental/components/avatar";
import { Bubble } from "@o/pipeline/experimental/components/chat/bubble";
import { Message } from "@o/pipeline/experimental/components/chat/message";
<Message.Root>
  <Message.Avatar>
    <Avatar.Root>
      <Avatar.Image src="https://github.com/shadcn.png" alt="@shadcn" />
      <Avatar.Fallback>CN</Avatar.Fallback>
    </Avatar.Root>
  </Message.Avatar>
  <Message.Content>
    <Bubble.Root>
      <Bubble.Content>How can I help you today?</Bubble.Content>
    </Bubble.Root>
  </Message.Content>
</Message.Root>

Note: Message owns the row layout—avatar, alignment, header, and footer. Render the visible message surface inside it with Bubble. For the scroll container around a conversation, use MessageScroller.

Composition

Use the following composition to build a message:

Message.Root
├── Message.Avatar
└── Message.Content
    ├── Message.Header
    ├── Bubble.Root
    └── Message.Footer

Use MessageGroup to stack consecutive messages from the same sender:

MessageGroup
├── Message.Root
└── Message.Root

Features

  • Start and end alignment for sender and receiver rows via the align prop
  • Avatar slot that anchors to the bottom of the message and stays clear of the footer
  • Header and footer slots for sender names, status, and message actions
  • Footer follows the message side; actions stay aligned on align="end" rows
  • Group wrapper for stacking consecutive messages from the same sender
  • Customizable styling through the className prop on every part

Avatar

Use Message.Avatar to render an avatar next to the message. Set align="end" on the message to align the avatar to the end of the message.

The build failed during dependency installation.
MA
Can you share the exact error?
Here's the error from the logs
Something went wrong with the build. The libraries are not installed correctly. Try running the build again.
alignDescription
startAlign the message to the start of the conversation.
endAlign the message to the end of the conversation.

Group

Use MessageGroup to stack consecutive messages from the same sender. Render an empty Message.Avatar on the earlier messages to keep them aligned with the avatar on the last one.

I checked the registry addresses.
The component and example JSON now live under the UI registry.

Use Message.Header for a sender name and Message.Footer for metadata such as a delivery or read status.

Alvish
I already checked the logs.
Send the report to the team. Ping @shadcn if you need help.
Read Yesterday

Actions

Place message-level actions in Message.Footer, such as copy, retry, or feedback buttons. Use Button for icon-only actions.

The install failure is coming from the workspace package.
Okay drop me a link. Taking a look…
Failed to send

Attachment

Render file and image attachments inside Message.Content with Attachment.

Workspace
Here's the image. Can you add it to the PDF? Use it for the cover page.
Done. Here's the PDF with the image added as the cover page.
sales-dashboard.pdfPDF · 2.4 MB
Thanks. Looks good.

Accessibility

Message is a presentational layout wrapper. Accessibility comes from the content you place inside it.

Label icon-only actions

Action buttons in Message.Footer are usually icon-only, so give each one an aria-label.

<Message.Footer>
  <Button variant="ghost" size="sm" icon aria-label="Copy">
    <IconCopy />
  </Button>
</Message.Footer>

Status updates

For in-progress messages, use a Marker with role="status" so assistive tech announces the update as it appears.

import { Marker } from "@o/pipeline/experimental/components/chat/marker";
import { Spinner } from "@o/pipeline/experimental/components/spinner";

<Message.Root>
  <Marker.Root role="status">
    <Marker.Icon>
      <Spinner />
    </Marker.Icon>
    <Marker.Content>Checking the logs...</Marker.Content>
  </Marker.Root>
</Message.Root>;

API Reference

Message.Root

The message row wrapper.

PropTypeDefaultDescription
align"start" | "end""start"The alignment of the message in the conversation.
classNamestring-Additional classes to apply to the row.

MessageGroup

Groups consecutive messages from the same sender.

PropTypeDefaultDescription
classNamestring-Additional classes to apply to the group root.

Message.Avatar

The avatar slot, aligned to the bottom of the message. When the message has a Message.Footer, the avatar shifts up to stay aligned with the message surface instead of the footer.

PropTypeDefaultDescription
classNamestring-Additional classes to apply to the avatar slot.

Message.Content

Wraps the header, message surface, and footer.

PropTypeDefaultDescription
classNamestring-Additional classes to apply to the content slot.

Message.Header

Displays content above the message, such as a sender name. Stays aligned to the start regardless of align.

PropTypeDefaultDescription
classNamestring-Additional classes to apply to the header.

Message.Footer

Displays content below the message, such as status or actions. Aligns to the message side.

PropTypeDefaultDescription
classNamestring-Additional classes to apply to the footer.