Displays a message in a conversation, with optional avatar, header, footer, and alignment.
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
Usage
<Message>
<MessageAvatar>
<Avatar>
<AvatarImage Src="https://avatar.vercel.sh/blazix" alt="@("@blazix")" />
<AvatarFallback>BX</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.
Composition
Use the following composition to build a message:
Message
├── MessageAvatar
└── MessageContent
├── MessageHeader
├── Bubble
└── MessageFooterUse MessageGroup to stack consecutive messages from the same sender:
MessageGroup
├── Message
└── MessageFeatures
- Start and end alignment for sender and receiver rows via the
Alignparameter - 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
Classparameter 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.
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.
Header and Footer
Use MessageHeader for a sender name and MessageFooter for metadata such as a delivery or read status.
Actions
Place message-level actions in MessageFooter, such as copy, retry, or feedback buttons.
Attachment
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="ButtonVariant.Ghost" Size="ButtonSize.Icon" aria-label="Copy"><Icon Data="LucideIcons.Copy" /></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>RTL
To enable RTL support in Blazix, see the RTL configuration guide.
Translated with AI for the demo, so it may have mistakes.
API Reference
Message
Other attributes are passed to the element it renders.
MessageAvatar
Other attributes are passed to the element it renders.
MessageContent
Other attributes are passed to the element it renders.
MessageFooter
Other attributes are passed to the element it renders.
MessageGroup
Other attributes are passed to the element it renders.
MessageHeader
Other attributes are passed to the element it renders.