Message

Markdown

One user, assistant or system message with its parts and references.

Good to know

  • In the chat variant a Markdown reply reads at the message size (16px), not the interface size.
  • Earlier replies keep their actions hidden until hovered or focused; the last reply always shows them.

Used in Recoverable chat and App shells.

Use it for
One message with its ordered parts, sources, tools and attachments.
Not for
A whole conversation surface. Try Chat.

Message preview

Which accounts need an owner review before archival?

Response complete

I found three accounts that need an owner review. Here’s the context to help you decide.

Response complete

Installation

npm install @stackunseen/ui
import { Message } from '@stackunseen/ui';
Styles: @stackunseen/ui/styles.css

Parts

Message draws one message. Its content and actions are components of their own, so you can use them in your own layout too.

How the parts fit together

tsx
<Message value={message}>
  <MessageActions text={text} onRetry={retry} onFeedback={rate} />
</Message>
  1. Message

    Who sent it and when, then the content. Children go after it.

    Propsvalue variant renderContent

  2. MessageContent

    Text, reasoning, files, sources and tool calls. renderContent replaces it.

    Built fromStreamingResponse, ToolCall, Attachment, Citation

    Propsvalue renderTextPart renderTool responseVariant sources tools attachments

  3. MessageActions

    Copy, plus Retry, Edit and feedback for the callbacks you pass.

    Propstext onRetry retryAvailability retryLabel onEdit editAvailability onFeedback feedbackValue

Usage and props

Display one user, assistant or system message. Supply plain text or ordered parts and resolve their references through sources, tools and attachments. Use renderTextPart to format text parts, or renderContent to replace the whole body. Give each message a stable ID, its role and a revision number.

valueMessageData
The id, role, state and revision, with either text or parts as its content.
sourcesreadonly Source[] (optional)
Source records matched to source parts by sourceId. Keep ids unique.
toolsreadonly ToolCallData[] (optional)
Tool records matched to tool parts by toolCallId. Keep ids unique.
attachmentsreadonly MessageAttachment[] (optional)
Attachment records matched by id and version, including access and preview data.
renderTextPart(part: TextMessagePart, variant: ComponentVariant<'StreamingResponse'>) => ReactNode (optional)
Render each text part, for example as Markdown. Keep the callback stable.
childrenReactNode (optional)
Content after the message body, such as MessageActions or extra attachments.
How state and callbacks work
All props

Loading…

For your coding agent

Give the agent this page instead of a screenshot. The prompt wraps the page with the install and import lines and the rule that your server, not a click, completes an action.

Contract
value: MessageData · sources? · tools? · attachments? · renderTextPart? · renderContent? · children
Keeps honest
Give each message a stable ID, its role and a revision number.
MCP
read_component "Message" on the docs endpoint
Open the Markdown file

Keyboard and customization

Keyboard

The message itself is an article. Tab reaches the links, disclosures and actions inside it; their controls handle keyboard interaction.

Customization

Change shared colors, spacing, corners and icons with the theme. Use the component's supported props to adapt its content and layout. Customization guide and Theme Studio