Prodular UI

AI

MessageAI

The layout of one turn in a conversation: who wrote it, where it aligns, and slots for header, content and footer.

npx prodular-ui add message

User and assistant

User text in a bubble on the right. Assistant text on the page, under a header with the AI mark.

How much do we owe Northbeam this month?
Ledgerline Copilot9:42

You owe Northbeam Logistics $27,852.50 across two open invoices. INV-20931 ($18,240.50) is due on October 30, and INV-20977 ($9,612.00) on November 14.

With avatars

For shared threads where several people talk to the assistant.

PS
Priya Shah10:14
Can you flag any invoice over $10,000 without a PO?
Ledgerline Copilot10:14

Three invoices match. I added the flag Needs PO to each and assigned them to Daniel Ortiz in Procurement.

Edited 2 fields in Payables

Anatomy

<Message from="assistant">  <MessageContent>    <MessageHeader><AiMark /> Copilot</MessageHeader>    <Response>{text}</Response>  </MessageContent></Message>

Guidance

Use it when

  • For every turn in a chat, an agent run log or a comment thread with an assistant in it.
  • from="user" aligns to the end, from="assistant" to the start.

Avoid

  • Putting assistant answers in a Bubble. Long answers read better on the page.
  • Avatars in one to one chats. A header with the AI mark is enough.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Always set from on Message. Assistant messages carry data-from="assistant", which is how generated content is marked in a thread.
  • Inside an assistant message, render parts in the order they were produced: MessageHeader, Reasoning, tool calls, Response, Sources, MessageActions, follow-up Suggestions.
  • Put the AI mark in MessageHeader or MessageAvatar of assistant messages, with model set to the model that produced it.
  • Wrap each Message in MessageScrollerItem when the thread scrolls.

API

Message

PropTypeDefaultDescription
from"user" | "assistant" | "system"Author. Sets data-from and the default alignment.
align"start" | "end"end for user, start otherwiseOverride the side.

MessageMeta

PropTypeDefaultDescription
childrenReactNodeTime, model or status next to the name, 12px.