Message

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

buridan add message

Component Guide

Use the following to build the Message component.

from components.ui.message import message

Source Code & Dependencies

For manual installation, copy each of the source codes below in their respective locations.

components/core/core.py

components/ui/message.py

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.

Examples

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.

Props used: align on message.root.

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

Group

Use message.group 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.

Props used: none required beyond default message.group composition.

I checked the registry addresses.
@avatarCN
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.

Props used: none required beyond default message.header/message.footer composition.

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

Actions

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

Props used: none required — place button(...) inside message.footer.

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

Attachment

Use the Attachment with the messages to displays a file or image attachment with media, metadata, upload state, and actions.

Props used: see the Attachment docs for attachment-specific props.

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(
        hi("Refresh03Icon"),
        variant="ghost",
        size="sm",
        title="Retry",
        aria_label="Retry",
    ),
)

Status updates

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

message.root(
    message.content(
        marker.root(
            marker.icon(spinner()),
            marker.content("Compacting conversation"),
            role="status",
        ),
    ),
)

API Reference

message.root

The message row wrapper.

Prop Type Default Description
align Literal["start", "end"] "start" The alignment of the message in the conversation.
class_name str - Additional classes to apply to the row.

message.group

Groups consecutive messages from the same sender.

Prop Type Default Description
class_name str - 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.

Prop Type Default Description
class_name str - Additional classes to apply to the avatar slot.

message.content

Wraps the header, message surface, and footer.

Prop Type Default Description
class_name str - 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.

Prop Type Default Description
class_name str - Additional classes to apply to the header.

message.footer

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

Prop Type Default Description
class_name str - Additional classes to apply to the footer.