Chat Thread
AI · ChatThread, DaySeparator, HandoffLine, SystemLine, VoiceLog, VoiceNote, TypingIndicator, ReadOnlyBar, ChatMessage
The conversation itself and the lines between its messages.
ChatThread: the scrolling log of a conversation. children (messages and lines), jumpTo (a message id: scrolls to it and marks it, e.g. from SearchHits), jumpKey (to jump to the same one again), stickToBottom (default true: follows the newest message while it streams, unless the reader scrolled up; then a button jumps to the latest), label.
- DaySeparator: "Today", "Yesterday" or the date between days; with
label="New messages"andtone="accent"above the first unread message. - HandoffLine: one agent passes the work to another:
from,to({name, tint, kind, avatar}),reason,time,href/onClickto open their conversation. - SystemLine: what happened around the messages (a model switch, a pause):
icon,time,tone("warning", "danger"). - VoiceNote: a voice message: play, seek, length and the transcript behind "Show transcript".
src,duration(seconds),transcript,peaks,mine. - VoiceLog: a finished voice conversation folded into one line:
duration,time,turns,audio(the recording, if it was kept). - TypingIndicator: "Lena is typing…", "Lena and Noah are typing…", "3 people are typing…".
- ReadOnlyBar: in place of the composer while you read along an agent-to-agent conversation, with "Step in".
Yesterday
Prorated April is €480 for 40 seats. Billed with the next invoice.
Atlas paused until the quote is approved
Today
New messages
0:14
Sending the quote needs an approval
Atlas and Lena Hart are typing…
You are reading along: Atlas and Ledger
Props
ChatThread
| Prop | Type | Notes |
|---|---|---|
children? | ReactNode | |
jumpTo? | string | Scrolls to the message with this `id` (a search hit) and marks it for a moment. |
jumpKey? | string | number | Change it to jump to the same message again. |
stickToBottom? | boolean | Follows the newest message while it grows, unless the reader scrolled up (default true). |
label? | string | Accessible name (default "Conversation"). |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
DaySeparator
| Prop | Type | Notes |
|---|---|---|
date? | Date | string | number | The day: shows "Today", "Yesterday" or the weekday and date in the provider's locale. |
label? | string | Text instead of the date (e.g. "New messages"). |
tone? | "neutral" | "accent" | "accent" for the "new messages" line (the signal colour). |
now? | Date | string | number | What counts as today (default now), for stable tests and server rendering. |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
HandoffLine
| Prop | Type | Notes |
|---|---|---|
from | HandoffParty | Who hands the work over. |
to | HandoffParty | Who takes it. |
reason? | ReactNode | Why, in a few words. |
time? | string | |
id? | string | |
href? | string | Opens the conversation between the two. |
onClick? | () => void | |
linkAs? | ElementType | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
SystemLine
| Prop | Type | Notes |
|---|---|---|
children? | ReactNode | |
icon? | IconName | |
time? | string | |
id? | string | |
tone? | "neutral" | "warning" | "danger" | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
VoiceLog
| Prop | Type | Notes |
|---|---|---|
title? | string | Default "Voice conversation". |
duration? | string | Length as shown ("4:12"). |
time? | string | |
turns | VoiceTurn[] | Required |
audio? | string | The recording, if it was kept. |
audioDuration? | number | |
id? | string | |
open? | boolean | |
defaultOpen? | boolean | |
onOpenChange? | (open: boolean) => void | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
VoiceNote
| Prop | Type | Notes |
|---|---|---|
src? | string | The recording (any URL the browser can play). |
duration? | number | Length in seconds (default: read from the file). |
transcript? | ReactNode | The words, behind "Show transcript". |
transcriptOpen? | boolean | |
onTranscriptOpenChange? | (open: boolean) => void | |
peaks? | number[] | Loudness per moment, 0 to 1, for the bars (default: a steady pattern). |
mine? | boolean | Drawn as the user's own (on the primary colour). |
label? | string | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
TypingIndicator
| Prop | Type | Notes |
|---|---|---|
names | string[] | Who is typing (renders nothing when empty). |
text? | string | Your own text instead of "Lena is typing…". |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
ReadOnlyBar
| Prop | Type | Notes |
|---|---|---|
text? | string | Default "You are reading along". |
actionLabel? | string | Default "Step in". |
onAction? | () => void | |
children? | ReactNode | |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |
ChatMessage
| Prop | Type | Notes |
|---|---|---|
role | "user" | "assistant" | "system" | Required |
id? | string | Stable id: `ChatThread jumpTo` scrolls to it (rendered as `data-message-id`). |
name? | string | |
time? | string | |
model? | string | |
text? | string | |
streaming? | boolean | |
tint? | Tint | |
icon? | IconName | Icon of a system line. |
sources? | Source[] | |
attachments? | ChatAttachment[] | Images show as thumbnails, other files as chips with a download link. |
mentions? | Mention[] | Mentions in a user's `text` (from `Composer`), drawn as tinted chips. |
highlight? | string | Marks the words of a search in the text. |
voice? | { src?: string; duration?: number; transcript?: ReactNode; peaks?: number[] } | A voice message instead of text: the player, its length and the transcript. |
dictated? | boolean | "Dictated" under the message. |
inVoice? | boolean | "In voice conversation" under the message. |
usage? | string | |
onRetry? | () => void | Regenerate: pass it on the last answer only. |
onFeedback? | (v: "up" | "down" | null) => void | Thumbs up or down (null when the reader takes it back). |
onFeedbackComment? | (v: "up" | "down", comment?: string) => void | The comment after thumbs down (an empty comment for thumbs up). |
actions? | boolean | `false` hides the action row; the rest of the props pick which actions show. |
actionsVisible? | "always" | "hover" | When the action row shows: "always", or "hover" (on hover and focus; always on touch screens). Default "always" for an answer with `onRetry` (the last one) and for a message with versions, else "hover". |
onEdit? | (text: string) => void | Edit in place on the user's own message: called with the new text. |
editing? | boolean | Controls whether the editor is open. |
onEditingChange? | (editing: boolean) => void | |
versionIndex? | number | Versions of an edited message or a regenerated answer: "‹ 2/3 ›" (0-based index). |
versionCount? | number | |
onVersionChange? | (index: number) => void | |
versionBusy? | boolean | While a version is being made. |
before? | ReactNode | Content above the bubble: a tool call, the reasoning, an approval card. |
after? | ReactNode | Content below the bubble: an approval card, a form, a result. |
children? | ReactNode | |
feedback? | "up" | "down" | null | |
linkAs? | ElementType | Router link for relative links in the text. |
className? | string | Extra class on the root element. |
style? | CSSProperties | Inline style on the root element. |