@reactloom/chat
v1.3.0
Published
Accessible React chat components for ReactLoom: a transcript that follows streaming replies without stealing the scroll position, messages, a prompt input with attachments and stop, citations and tool-call blocks. Provider-neutral: no model SDK.
Downloads
796
Maintainers
Readme
@reactloom/chat
Accessible chat components for ReactLoom: MessageList, Message, PromptInput, Citations
(with CitationRef) and ToolCall. They render a conversation; they do not talk to a model, so
any provider or SDK works.
pnpm add @reactloom/chat @reactloom/ui @reactloom/themeimport '@reactloom/chat/styles.css';
import { Message, MessageList, PromptInput } from '@reactloom/chat';
<MessageList style={{ blockSize: 480 }}>
{messages.map((m) => (
<Message key={m.id} sender={m.role} status={m.streaming ? 'streaming' : 'complete'}>
{m.text}
</Message>
))}
</MessageList>
<PromptInput onSubmit={send} streaming={isStreaming} onStop={abort} />;- The transcript follows a streaming reply only while the reader is at the bottom; scrolling up is never interrupted, and a “Jump to latest” button appears instead.
- Screen readers hear each reply once, when it is complete, not token by token.
- Enter sends and Shift+Enter adds a line. Text being composed with an input method is never sent early, and Send becomes Stop while a reply streams.
Documentation and live examples: https://www.reactloom.dev/components/chat
