Chat
Organism
A controlled assistant conversation with independently scrolling messages, clear author and provider identities, and an anchored multiline composer. The parent supplies the bounds; Chat fills the available height without choosing a fixed height of its own.
Playground
Every control sets a real prop of ChatProps. The JSX below updates as you go.
Web
iOS
Android
JSX · ChatProps
Variants
10 examples from src/organisms/chat/chat.md, each rendered live from its own JSX.
Anatomy
1
Thread
2
Assistant message
3
User message
4
Avatar
5
Composer
Dimmed parts appear only in some states or variants.
Props
33 props on ChatProps, grouped as they are declared in source. Required props are marked *.
Accessibility and keyboard
Keyboard
Type
Edits the value
Tab
Next field
Escape
Clears when clearable
Semantics
Roles
cell
columnheader
header
heading
progressbar
row
table
text
States
busy
ARIA on web
aria-busy
aria-expanded
aria-hidden
aria-label
aria-level
aria-live
From the docs
Messages remain application-owned ChatMessageData: keep each id stable while updating content during streaming. pending shows a three-dot thinking indicator until an explicitly streaming message arrives; pass pendingIcon to identify its provider. Streaming replies retain their own Responding indicator. Both animations stop when their state ends and stay still under Reduce Motion. providerIcon accepts an application-supplied provider logo beside the author; label the image or icon with the provider nam
ChatThread follows new content while the reader is within 48 points of the bottom. Scrolling up to read older messages pauses following; returning to the bottom resumes it. Message updates, streaming text, question-height changes, and viewport resizing coalesce into a tail adjustment after layout settles. Scrolling is immediate and never animated, so it does not add motion when text streams or Reduce Motion is enabled. The overflowing thread is keyboard focusable with a visible focus frame. The native app or owni
Set onAttach to show the accessible paperclip action. The app owns file picking and uploading, passes composer attachments, and removes a staged file through onRemoveAttachment(id). A ChatAttachmentData has an id, name, optional uploading or error flags, and optional notice text. Uploading and failed files block sending; remove a failed file or replace it after retrying. attaching also blocks attaching and sending while the app opens a picker or uploads. Saved message attachments use the same me
Both answer callbacks and an enabled form are required for interaction. disabled, pending, and active streaming lock the current question. Use questionsDisabled for an inactive earlier batch: it shows every original question and option read-only, without navigation actions. questionsSubmitted shows saved answers with an Answers sent receipt. Multiple-choice receipts include every selected label and custom text; an answer-mode override is identified as Multiple answers selected by you. Question labels and de
The current question is framed by the existing compact, flat selected Card: a soft theme tint and primary border distinguish its counter, answers and actions from the surrounding conversation. Saved receipts and inactive question history remain unframed. The Card is visual only, so answer controls retain their own accessible roles and focus behavior.
Markdown reuses Chat's safe grammar and renderer for standalone documents. It preserves heading levels one through six, emphasis, inline and fenced code, quotes, ordered and unordered lists, nested indentation, static checked/unchecked task lists, horizontal rules, and pipe tables. Tables use Canvas DataTable's container-responsive stacked layout on narrow surfaces, retaining every column on iOS too. Checklists are read-only Canvas selection controls; reading a document never changes its source. HTML, links and i
Platform skins
The playground's props on each platform: same tree, native shapes, type and touch sizes.
Usage
Messages remain application-owned ChatMessageData: keep each id stable while updating content during streaming. pending shows a three-dot thinking indicator until an explicitly streaming message arrives; pass pendingIcon to identify its provider. Streaming replies retain their own Responding indicator. Both animations stop when their state ends and stay still under Reduce Motion. providerIcon accepts an application-supplied provider logo beside the author; label the image or icon with the provider name for assistive technology. provider remains an optional supplementary text label such as the transport name. error adds a visible failure label; notice preserves delivery or fallback information. footer anchors connection, review, or other actions below the composer and outside the scrollport.
Chat draws the conversation as a card: messages 14 points apart inside a 16 point inset, assistant replies as plain 14 point text with no author line unless the app names an author or a provider (several AIs in one conversation), the person's own turns as a bubble in the accent's soft wash on the trailing side, and the composer under a hairline, its sunken field holding the draft and a round send button. Set flush to drop the card frame so the conversation sits directly on its host's fill, for example inside a Drawer or a Wizard body.
Set assistant to lay the conversation out like a desktop assistant's window instead. The thread and the composer share one centered column whose composer box is 768 points wide at most, with the user's bubble 16 points in from its edge. Assistant replies are plain 15 / 21 text across the column, 20 points in from the composer's edge, with list items on the line rhythm and paragraphs 12 apart. The person's own turns are a neutral bubble, 12 by 16 points in. Turns that change speaker sit 40 points apart and the blocks of one turn 20 apart. The composer is one raised, rounded 44 point box with no divider: a bare add icon, the draft, and a send control that stays quiet until there is something to send. The thread and the composer keep 24 point gutters; when either is narrower than 480 points (a phone, a side panel, a wizard body) the gutters shrink to 12 so the composer's text keeps its room. With assistant, meta names what will answer (a model, a provider) in one muted line at the end of the column under the composer. assistant and flush combine: a Wizard assistant body or a Drawer usually wants both.
Tokens
Read from the playground render. Values follow the scheme and the ion hue.
--bg2
--fd
--ft
--ion
--ion-fg
--ion-soft
--ion-tx
--ln
--ln2
--sf
--sf2
--tx3