App components / AI chat
Chat message
The messages of a conversation and their parts. The user's message sits right in a soft bubble with its files or the answer it replies to; the assistant's answer moves from thinking through streaming to complete, with tool calls, citations, sources, actions and versions.
Code
The component itself, ready to drop into your project. Switch between React, Vue and plain HTML; every version uses the same Tailwind classes on Ochre's tokens.
Assistant Deep
The plan has three dates that could slip:
- 1.Beta invites go out on 3 November, two days after the design freeze, which leaves no buffer.
- 2.Pricing page copy is due the same week as the press brief.
- 3.Data migration for older workspaces has no owner yet.
My suggestion: move the beta to the week of 10 November and give the migration to the platform team.
Installation
Examples
Assistant states
Thinking with its steps, streaming, stopped and error.
Thinking
Assistant Deep
Thinking
Streaming
Assistant Deep
Stopped
Assistant Deep
The plan has three dates that could slip. The first is the beta invites, which go out two days after the design freeze.
You stopped this answer.
Error
Assistant Deep
I couldn't reach the calendar, so the dates may be out of date.
User messages
Text, an attachment, several files and a reply.
Replying to “Move the beta to the week of 10 November”
Parts
Tool calls, source chips, citations and their cards, message actions and the version pager.
Tool call
Source chip and citation
Citation card
Message actions
Version pager
Edit message
Sending makes a new version of the answer.
Motion
Built on Ochre's ease-out curves. With reduced motion switched on, everything still works, it just doesn't move.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| UserMessage children / attachments / replyTo | ReactNode, MessageAttachment[], string | – | Figma's Content: Text, Attachment, Files, Reply. |
| UserMessage copyText / onEdit / editing / onEditSubmit / onEditCancel | string, () => void, boolean | – | Edit and Copy on hover; editing shows EditMessage. |
| AssistantMessage state | "complete" | "streaming" | "thinking" | "stopped" | "error" | "complete" | Where the answer is. |
| AssistantMessage text / children | string, ReactNode | – | Pass text while streaming so new words rise in; children for rich answers with Citation. |
| AssistantMessage thought / onThought | ReactNode, () => void | – | "Thought for 8 seconds" above the answer; opens the Reasoning panel. |
| AssistantMessage steps | ToolCallProps[] | – | Tool calls shown while thinking. |
| AssistantMessage sources | Source[] | – | { kind, source, title, quote, where, href, onOpen }: numbered chips under the answer. |
| AssistantMessage versions | { current, total, onPrevious, onNext } | – | Figma's Show versions. |
| AssistantMessage onRetry / onContinue / error | () => void, ReactNode | – | Regenerate or Try again; Continue a stopped answer. |
| AssistantMessage copyText / onReply / onSave / onShare / feedback / onFeedback | … | – | The actions under the answer. |
| ToolCall kind / status / title / detail / onOpen | "search" | "files" | "code", "running" | "done" | – | One step the assistant takes. |
| Citation number / source / active | number, Source, boolean | – | Inline reference; pressing it opens its CitationCard. |
| MessageActions side / framed | "user" | "assistant", boolean | – | Edit and Copy, or Reply, Copy, Good, Bad, Regenerate, Save, Share and More. |
| VersionPager current / total | number | – | ‹ 2 / 3 ›. |
Usage
Use it for
- UserMessage for what the person sent: text, an attachment, several files or a reply; Edit swaps it for EditMessage.
- AssistantMessage in five states: thinking with its ToolCall steps, streaming, complete, stopped with Continue, error with Try again.
- Citation inline after the sentence it supports; its card shows the quoted passage. SourceChip lists the sources under the answer.
Avoid
- A spinner or orb for thinking: the steps say what's happening, and the Assistant mark turns.
- Citations without a source behind them: every number opens a card.
- Showing every action all the time on user messages: they appear on hover and focus.