Conversation
A React component in Beamline's AI & agents category.
The scrolling column of a conversation: follows new content while you are at the bottom, stops when you scroll up to read, and offers a way back; shared by the agent conversation and the people chat.
Use it for
- The message column of any chat: agent conversations (with message and response) and people chat (chat-thread builds on it).
Not for
- A feed of events (timeline).
- A plain scrolling region (scroll-area).
Anatomy
- Conversation (scroll element; role log, named by aria-label; aria-busy while an answer arrives; a size container)
- ConversationContent (reading column, --conversation-width, default 720px; in a room under 24rem its margins and the space between turns tighten)
- ConversationScrollButton (Jump to latest; an accent dot, and ", new below" in its name, when content arrived below while the reader was away)
- ConversationEmptyState (title, description, icon, starter action)
- useConversation() (isAtBottom, scrollToBottom)
States
- following the bottom
- reading history (jump button shown)
- busy (an answer is streaming)
- empty
- new below while reading (the jump button carries a dot)
Keyboard
- The log scrolls with the keyboard like any scroller; Jump to latest is a button with its own name.
Motion
New content follows with a smooth scroll (instant under reduced motion); the jump button arrives in --pui-motion-in and leaves in --pui-motion-out, rising 6px (a fade only under reduced motion). The new-below dot settles in once; the content is watched only while the reader is away from the latest.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
Conversation: busy | boolean | — | busy: True while an answer is still arriving: assistive tech waits for it to settle instead of reading every token. |
Conversation: …StickToBottom props | initial, resize, aria-label … | — | initial/resize default to smooth (instant with reduced motion). |
ConversationScrollButton: label | string | — | label: On ConversationScrollButton: Accessible name and tooltip-free label of the button. Default "Jump to latest". |
ConversationEmptyState: title / description / icon / action | ReactNode | — | title: On ConversationEmptyState: Heading shown above the content. Defaults to "No messages yet". description: On ConversationEmptyState: Supporting text beneath the label or heading. Defaults to "Ask a question to start.". icon: On ConversationEmptyState: Icon element shown beside the label. Defaults to no leading icon. action: On ConversationEmptyState: Action element displayed beside the message. Defaults to no action. |
useConversation() | () => { isAtBottom, scrollToBottom } | — | Inside a Conversation: take the reader to the latest message (after they send). |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented root element; no ref by default. |
classNames | ConversationClassNames; ConversationScrollButtonClassNames | — | Classes for the named visual parts; no part overrides by default. |
busy | boolean | — | True while an answer is still arriving: assistive tech waits for it to settle instead of reading every token. |
ref | Ref<HTMLDivElement> | — | Receives the documented root element; no ref by default. |
ConversationEmptyState.title | ReactNode | — | On ConversationEmptyState: Heading shown above the content. Defaults to "No messages yet". |
ConversationEmptyState.description | ReactNode | — | On ConversationEmptyState: Supporting text beneath the label or heading. Defaults to "Ask a question to start.". |
ConversationEmptyState.icon | ReactNode | — | On ConversationEmptyState: Icon element shown beside the label. Defaults to no leading icon. |
ConversationEmptyState.action | ReactNode | — | On ConversationEmptyState: Action element displayed beside the message. Defaults to no action. |
ConversationScrollButton.label | string | — | On ConversationScrollButton: Accessible name and tooltip-free label of the button. Default "Jump to latest". |
ConversationScrollButton.loading | boolean | — | On ConversationScrollButton: Shows a loader in front of the label, sets aria-busy and ignores clicks; size and focus stay. |
ConversationScrollButton.asChild | boolean | — | On ConversationScrollButton: Render the single child (a link, a Radix trigger) with the button's look instead of a <button>. |
ConversationScrollButton.tone | ButtonTone | — | On ConversationScrollButton: Market side. On primary/accent the fill becomes --pui-up (buy) or --pui-down (sell); on the quiet variants the label takes that colour. Pair it with a word or arrow: colour is never the only signal. |
ConversationScrollButton.variant | ButtonVariant | — | On ConversationScrollButton: Visual weight: primary (ink-filled), secondary, outline, ghost, danger, or accent (filled with the brand). |
ConversationScrollButton.size | ButtonSize | — | On ConversationScrollButton: Height 32 / 36 / 40 px; touch 44 px for a bottom action bar on a phone. |
ConversationScrollButton.look | BuiltInLook | — | On ConversationScrollButton: Paint this button in another look than the one in force around it (DESIGN-LANGUAGE.md "Looks"). |
ConversationScrollButton.iconOnly | boolean | — | On ConversationScrollButton: A square button holding only an icon (give it an aria-label). Decided by the children when left out: icon-only when no words sit anywhere among them (an icon, or a frame of icons), so `<span>Close</span>` is a label. |
Built from
- button
- empty-state
Used in
Dependencies
use-stick-to-bottom, lucide-react, motion
Import
import { ConversationContent, Conversation, ConversationEmptyState, ConversationScrollButton, useConversation } from "@beamline/conversation";
Get it
Conversation is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in AI & agents
- Image generation: The frame an AI image is generated into: a field of brand-hued pixels breathes with the progress while the model works, then the image arrives —…
- Flowchart: A workflow as steps on a dotted canvas: a trigger, conditions that branch into paths side by side, actions and waits, read top to bottom; during a run…
- Run trace: One agent run as a waterfall: every step (model calls, tools, retrieval, checks, sub-agents) nested under the step that started it, each a bar on a…
- Run theatre: One agent run as a theatre: the Run trace's waterfall under a transport (play, scrub, speed) that replays the run as it happened. Pick a step and re-run…
- Answer compare: Two answers to the same prompt side by side, and a person's verdict: A is better, a tie, B is better, or both are bad, with the reasons that decided it…
- Branch navigator: The versions of an assistant conversation that forked when a message was edited or an answer regenerated: a “‹ 2 / 3 ›” switch on each message that has…
- Response: An assistant's answer as streamed markdown in the system's reading type: bursty tokens flow in at an even pace, each new word fades in through a short…
- Chat thread: People talking to people: messages grouped by person and day, reactions, delivery and read receipts that glide to the newest message read, who is typing…
- Model picker: Choose the AI model for a request by what it can do and what it costs: a trigger with the model's name opens a searchable list grouped by provider, with…
- Task rows: Background work an agent is doing, one row per task: status as a glyph and a word, what it produced, how long it has run or took, a progress bar while…
- Context cards: The knowledge an agent retrieved before it answered: one card per chunk with what it is about, the text it read with the search words marked, how…
- Prompt suggestions: Ready-made prompts a person can start from or follow up with: chips, cards or a list; a picked one lifts off and flies into the composer as its text…
- Plan: An agent's plan: numbered steps with live status, progress, and Approve / Edit / Reject when it needs sign-off; approving shows progress, and a refusal…
- Approval card: The agent stops and asks before it acts: what it wants to do, exactly what that changes, any choices it needs, and Approve or Reject; both run your…
- Tool call: One tool call in an agent's run: status, what it did and a short result on one quiet row that opens to the exact input and output; stops for permission…
- Recommendation card: One suggestion from the agent that the person may take or leave: what it suggests, why, the expected effect and how sure it is (a meter and a word…
- Citations: Inline numbered citations that preview their source on hover or focus, plus a numbered source list; streamed answers flow in at an even pace with the…
- Reasoning: The agent's trace, fed by your stream: a shimmering label and the seconds so far while it works, then "Thought for N seconds"; steps that check off…
- Attachment: A file tile: preview or typed glyph with the type named, name, size, upload progress, error with retry, and a keyboard-reachable remove.
- Prompt bar: The agent composer: a field that grows, @ to add a source, / for a command, a model picker, files and dictation, and one button that sends with progress…
- Selection actions: Select a passage and hand it to the agent: a bar over the selection with quick actions, your own instruction and More; while the agent works it says so…
- Message: One turn in a conversation with an agent: the person's words in a quiet bubble, the agent's answer on the page with its orb mark, trace, tool calls and…