Message
v0.64.0, changelogBetaOne turn of a conversation with a model or agent: a role word, name and time (never a bubble colour), any body, then its actions and a quiet line of facts; streaming is aria-busy.
Turns
Install
npx shadcn add @syncrobotic/message Also installs: lucide-react@^1, @syncrobotic/cn, @syncrobotic/button, @syncrobotic/format-number, @syncrobotic/streaming-text
Overview
When to use
- An operator's assistant: the person's question and the assistant's streamed answer.
- An agent's tool calls shown in the conversation, each a Tool turn with a Trace inside.
- A system note at the start of a conversation: what the assistant may and may not do.
Use something else
- One answer on its own, with no conversation around it: Streaming text.
- An agent run read step by step: Trace, or the
agent-traceblock. - Comments people leave on a record: Timeline.
More examples
States and real uses. Each example is also a Storybook story and a visual regression test.
Streaming
Tool
Error
Stopped
Align end
System
Traditional Chinese (zh-TW)
Usage rules
- Map your API's
rolestraight torole: user, assistant, tool or system. - Who spoke is the role word in the header (You, Assistant, Tool, System), with
nameafter it (the person, the assistant, the tool called). Never tell roles apart by a bubble colour or by alignment alone:align="end"may move a person's turns to the end of a wide container, and they keep the word. - Every turn is on neutral ground. A person's turn has a quiet
surface(muted) by default; nothing takes a colour for its role. - Pass
timealready formatted ("14:02") anddateTimefor machines. Format it once in the browser, or with a time zone, so the server and the page agree. - The body is
children: StreamingText for a streamed answer, Trace for tool calls, Attachment for files, your markdown renderer. Message parses nothing. - While the answer arrives set
status="streaming"(aria-busy). When the body is StreamingText, leave the final state to it (its status row says Done, Stopped or Failed) and clearstatus; use Message'serrorandstoppedfor a turn whose body cannot say it, such as a person's turn that was not sent. - Facts about the answer go in
footerwithMessageMeta(model, duration, tokens, numbers through format-number); its actions go inactions(message-actions). - The same speaker's next turn takes
continued: the header stays for screen readers only. Put the turns in amessage-scroller.
Changelog
- 0.64.02026-12-01Formatted with Prettier (class order sorted); the code is unchanged.
- 0.53.02026-11-27Read without stray punctuation: names come from the words shown, with real spaces between them. Its doc opens with its description.
- 0.51.02026-11-27Comments trimmed to what they need to say; the code is unchanged.