History
Scroll back, then add a reply. Your place stays fixed until you choose Jump to latest.
Recorded messages · No model connected
Keeps a scrollable message history at the latest response until the reader scrolls back.
Scroll back, then add a reply. Your place stays fixed until you choose Jump to latest.
Recorded messages · No model connected
npm install @noorddev/vlak-react
Load the stylesheet once at your app root, then import the components you use.
import "@noorddev/vlak-react/css";
import { Conversation, MessageComposer, Response, ResponseActions, type ComposedMessage } from "@noorddev/vlak-react";Per-component imports are available at @noorddev/vlak-react/components/conversation.
npx @noorddev/vlak-cli add conversation
Adds the component and its dependencies to components/vlak/. Follow the StyleX setup to compile the source in your application.
npx shadcn add https://vlak.dev/r/conversation.json
Installs the same source through the shadcn CLI.
import { Conversation, MessageComposer, Response, ResponseActions, type ComposedMessage } from "@noorddev/vlak-react";
export function DocumentConversation({ onSend, generating, onStop }: {
onSend: (message: ComposedMessage) => void | Promise<void>;
generating: boolean;
onStop: () => void;
}) {
return <>
<Conversation label="Document conversation" maxHeight="28rem">
<Response from="user">Summarize this document.</Response>
<Response actions={<ResponseActions text="The document has three sections." />}>
<p>The document has three sections.</p>
</Response>
</Conversation>
<MessageComposer compact maxRows={6} sendOnEnter onSend={onSend} generating={generating} onStop={onStop} />
</>;
}See the integration example to compose these components with your application's model and data.
A message history that follows new content without taking the reader away from earlier messages.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | "Conversation" | Accessible name of the scrollable message history. |
maxHeight | Property.MaxHeight<string | number> | "28rem" | Maximum height of the message history, before it scrolls. |
autoScroll | boolean | true | Follow new content while the reader is at the end. |
latestLabel | string | "Jump to latest" |
Also accepts HTMLAttributes<HTMLDivElement>.
The ref reaches HTMLDivElement.
| Keys | Does |
|---|---|
| Tab | Focuses the scrollable log and its interactive contents |
| Arrow keys, Page Up, Page Down | Scrolls the focused history using native browser behavior |
| Enter, Space | Activates Jump to latest and returns focus to the history |
The same styles are available as CSS. Native HTML provides the static presentation; React or application code supplies state updates and actions.
npm install @noorddev/vlak
import "@noorddev/vlak/css";
<div class="rs-conversation"><div class="rs-conversation-viewport" role="log" aria-label="Conversation" aria-live="off" tabindex="0" style="max-height:28rem"><div class="rs-conversation-content"><p>You: Summarize this document.</p><p>Assistant: The document has three sections.</p></div></div></div>