Agentic
Message
One turn in a conversation. The person's message is a bubble with Copy, Edit, and the time; the agent's turn holds its thinking, tool calls, and reply.
Usage
With the AI SDK
Branch on the message role. Editing calls sendMessage with the message's id, which replaces it and runs the turn again. An error before any reply marks the last message as not sent, and Retry calls regenerate.
With TanStack AI
Text parts carry content instead of text. The docs do not show how to replace a sent message, so pass Edit to your own handler.
Examples
Group chat
Others sit on the left with their name and picture; the reader's own message sits on the right.
Attachments
Files the person sent sit above their words. Images open in a lightbox; other files open in a new tab.
Not sent
A message that did not go out stays in place with Retry.
Long text
Pasted text folds after eight lines, with Show more.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Use from="user" for people and from="agent" for the agent's turn, and put AgentThinking, ToolCallGroup, and StreamingText inside the agent's Message in the order they arrive. Add author and avatar only in group chats. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | The application stores messages and runs turns. Message shows one turn; Edit only reports the new text. |
| Scope | Show time in the reader's time zone. Format it on the client or from their settings, and pass the instant as dateTime. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | — | user is a person's message in a bubble; agent holds the agent's parts in a column without a bubble. |
| | — | What the person wrote, for from="user". For from="agent", the parts in order, such as AgentThinking, ToolCallGroup, and StreamingText. |
| | "end" | end for the person reading, start for others in a group chat. |
| | — | The sender's name above the message, and their picture beside it. Use them in group chats. |
| | — | Files the person sent, shown above the bubble as the same tiles Composer showed. Images open together in a lightbox, showing href when set; other files with an href open in a new tab. |
| | — | The send time formatted for the reader, such as 4:20 PM, and its machine-readable instant. |
| | — | Shows Edit, which opens the text in place. Enter sends, Shift+Enter adds a line, and Escape cancels. Called only when the text changed. |
| | "sent" | failed keeps the message with Not sent in view, and onRetry adds Retry beside it. |

