HomeDocsComponentsBlocksChartsThemes
Introduction
  • Introduction
  • Installation
  • Themes
  • llms.txt
Components
  • Accordion
  • Alert
  • Alert Dialog
  • Amount
  • Aspect Ratio
  • Audio Player
  • Avatar
  • Avatar Upload
  • Badge
  • Banner
  • Breadcrumb
  • Button
  • Button Group
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Code Block
  • Collapsible
  • Color Picker
  • Combobox
  • Command
  • Context Menu
  • Copy Button
  • Countdown
  • Data Grid
  • Data Table
  • Date Picker
  • Date Range Picker
  • Description List
  • Device Mockup
  • Dialog
  • Direction
  • Dot Loader
  • Drawer
  • Dropdown Menu
  • Empty
  • Field
  • File Upload
  • Hover Card
  • Input
  • Input Group
  • Input OTP
  • Item
  • Kanban
  • Kbd
  • Label
  • Meter
  • Multi Select
  • Native Select
  • Number Field
  • Pagination
  • Password Strength
  • Phone Input
  • Popover
  • Progress
  • Progress Circle
  • Radio Group
  • Rating
  • Resizable
  • Responsive Dialog
  • Rich Text Editor
  • Scroll Area
  • Segmented Control
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Signature
  • Skeleton
  • Slider
  • Sonner
  • Sortable
  • Spinner
  • Stat
  • Stepper
  • Switch
  • Table
  • Tabs
  • Tag Input
  • Terminal
  • Textarea
  • Time Field
  • Timeline
  • Toast
  • Toggle
  • Toggle Group
  • Tooltip
  • Tree
  • Typography
  • Video Player
  • Window Mockup
AI
  • Message Scroller
  • Message
  • Bubble
  • Marker
  • Attachment
  • Questionnaire
  • Composer
  • Reasoning
  • Tool Call
  • Approval Card
  • Citations
Blocks
  • Airtable
  • Airtable Kanban
  • ClickUp List
  • ClickUp Kanban
  • Repeatable Group
  • Command Palette
  • Sign In and Sign Up
  • Availability Scheduler
  • AI Chat
  • Action Bar
  • Notion
  • Banking
  • Lineup Builder
  • Sports Score
  • Strava
  • Sheets
  • Notices
  • Settings
  • Billing
Utilities
  • motion
  • sounds
  • scroll-fade
  • shimmer
Another UI. Built on shadcn/ui with Phosphor icons.

Message

PreviousNext

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

Base UIReact AriaRadix UI
@me
ME
Deploying to prod real quick.
@rabbit
R
It's 4:55 PM. On a Friday.
@me
ME
It's a one-line change.
Delivered
@rabbit
R
It's always a one-line change 😭.
Alright, let me take a look.
👍
Oliver is typing...
import {
  Avatar,
  AvatarFallback,

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#

pnpm dlx shadcn@latest add https://anotherui.dev/r/message.json

Usage#

import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Bubble, BubbleContent } from "@/components/ui/bubble"
import { Message, MessageAvatar, MessageContent } from "@/components/ui/message"
<Message>
  <MessageAvatar>
    <Avatar>
      <AvatarImage src="https://github.com/jvendramin.png" alt="@jvendramin" />
      <AvatarFallback>CN</AvatarFallback>
    </Avatar>
  </MessageAvatar>
  <MessageContent>
    <Bubble>
      <BubbleContent>How can I help you today?</BubbleContent>
    </Bubble>
  </MessageContent>
</Message>

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
├── MessageAvatar
└── MessageContent
    ├── MessageHeader
    ├── Bubble
    └── MessageFooter

Use MessageGroup to stack consecutive messages from the same sender:

MessageGroup
├── Message
└── Message

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 MessageAvatar to render an avatar next to the message. Set align="end" on the message to align the avatar to the end of the message.

@avatar
R
The build failed during dependency installation.
@avatar
R
Can you share the exact error?
@avatar
R
Here's the error from the logs
Something went wrong with the build. The libraries are not installed correctly. Try running the build again.
import {
  Avatar,
  AvatarFallback,
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 MessageAvatar on the earlier messages to keep them aligned with the avatar on the last one.

I checked the registry addresses.
@avatar
CN
The component and example JSON now live under the UI registry.
import {
  Avatar,
  AvatarFallback,

Header and Footer#

Use MessageHeader for a sender name and MessageFooter for metadata such as a delivery or read status.

Olivia
I already checked the logs.
Send the report to the team. Ping @jacob if you need help.
Read Yesterday
import { Bubble, BubbleContent } from "@/components/ui/bubble"
import {
  Message,

Actions#

Place message-level actions in MessageFooter, such as copy, retry, or feedback buttons.

The install failure is coming from the workspace package.
Okay drop me a link. Taking a look...
Failed to send
import { ArrowClockwiseIcon, CopyIcon, ThumbsDownIcon, ThumbsUpIcon } from "@phosphor-icons/react"

import { Bubble, BubbleContent } from "@/components/ui/bubble"

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.
"use client"

import { DownloadIcon, FileTextIcon } from "@phosphor-icons/react"

Accessibility#

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

Label icon-only actions#

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

<MessageFooter>
  <Button variant="ghost" size="icon" aria-label="Copy">
    <CopyIcon />
  </Button>
</MessageFooter>

Status updates#

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

<Message>
  <Marker role="status">
    <MarkerIcon>
      <Spinner />
    </MarkerIcon>
    <MarkerContent>Checking the logs...</MarkerContent>
  </Marker>
</Message>

API Reference#

Message#

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.

MessageAvatar#

The avatar slot, aligned to the bottom of the message. When the message has a MessageFooter, 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.

MessageContent#

Wraps the header, message surface, and footer.

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

MessageHeader#

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.

MessageFooter#

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

PropTypeDefaultDescription
classNamestring-Additional classes to apply to the footer.
MarkerMessage Scroller

On This Page

InstallationUsageCompositionFeaturesAvatarGroupHeader and FooterActionsAttachmentAccessibilityLabel icon-only actionsStatus updatesAPI ReferenceMessageMessageGroupMessageAvatarMessageContentMessageHeaderMessageFooter