Skip to content
Design System
GitHub

One 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.

API reference

Generated from the types. Every part also takes className.

Message

Also takes every prop of <article> (except role, children).

rolerequired
"user" | "assistant" | "tool" | "system"Who spoke: the role word leads the header and the accessible name. Named role after the chat APIs' field.
name
stringWho exactly, after the role word: a person's name, the assistant's or the model's name, the tool called.
time
stringWhen, as shown ("14:02"). Format it once, in the browser or with a time zone, so the server and the page agree.
dateTime
stringThe same moment for machines (an ISO 8601 string), on the <time> element.
avatar
ReactNodeA picture before the role word: an Avatar at size "sm". Hidden from screen readers: the role word names the turn.
status
"streaming" | "error" | "stopped"See MessageStatus. Leave it undefined when the body (StreamingText) already shows the final state.
error
stringWith status "error": what went wrong, in words, after "Failed".
onRetry
() => voidWith status "error": shows Try again.
align
"start" | "end" = "start""end" moves the turn to the end of a wide container (@container 42 rem and up); below that every turn starts at the start.
surface
boolean = role === "user"A quiet surface under the body. On by default for the user's turns.
continued
boolean = falseThe same speaker's next turn: the header is kept for screen readers only.
footer
ReactNodeFacts about the turn, under the body: MessageMeta, or your own.
actions
ReactNodeThe turn's actions (MessageActions), under the body, before the footer's facts.
children
ReactNodeThe body: StreamingText, Trace, attachments, your markdown renderer.
labels
Partial<MessageLabels>

MessageMeta

model
stringThe model that answered, as people know it.
durationMs
numberHow long the answer took, in ms.
tokens
numberTokens used (prompt and answer, or as your API counts them).
locale
stringFormats the numbers. Left out, English, so the server and the browser write the same.
labels
Partial<MessageMetaLabels>
children
ReactNode