One message of a chat, a person's message in a bubble or the assistant's answer as full-width prose. Each Message.Root renders an <li>, so put it in Conversation's Conversation.Content.
When to use
- Show one message of a chat with an assistant or a model, with actions such as copy.
- Show a marker while the answer is on its way.
- Use Conversation for the transcript that holds the messages.
An answer on its way
Render Message.Pending under the part of the answer that arrived, until the answer ends. A first sentence such as "Let me check your endpoints." can come before seconds of tool calls, so keep the marker after the first text. It is not a live region: Conversation.Root announces the start and the end of the answer once.
Composition
Polymorphism
Message.Root and Message.Actions take asChild. Message.Content and Message.Pending do not, because each renders an element beside its children.
Accessibility
Message.Content starts with a visually hidden speaker label, "You said:" or "The assistant said:", so a screen reader says who wrote each message.
Translation
Message.Content and Message.Pending render an element beside their children: the speaker label and the pulsing dot. Each wraps the children in a display: contents element (message-content-label and message-pending-label), so a page that a browser translates survives a change to them.
API Reference
Message.Root
One message: an <li> that lays out the content, the actions, and any pending marker.
All props from li, plus:
Message.Content
The body of a message: a bubble for a person, full-width prose for the assistant.
All props from div.
Message.Pending
A marker with a pulsing dot that an answer is on its way, such as "Thinking…".
All props from div.
Message.Actions
A row of small actions and facts under a message, such as a copy button.
All props from div, plus: