Chat surface
Conversation plus Message plus Reasoning plus PromptInput, fully composed. The flagship Gremorie AI surface.
Overview
A complete AI chat surface: a streaming conversation log with stick-to-bottom
scrolling, user and assistant messages, an expandable reasoning
collapsible, and a PromptInput composer at the bottom.
This is the flagship Gremorie block. Wire it to the AI SDK or any streaming endpoint and you get a production-ready chat surface in a single import.
Preview
What did the team ship this week?
Here is a quick weekly recap:
**Shipped**
- Auth flow with GitHub provider
- Dashboard analytics widget
**In flight**
- Settings form (3 sections)
- Empty state pattern
**Blockers**
- Waiting on API key for analytics provider
Anatomy
The block composes:
- Conversation / ConversationContent - stick-to-bottom scroll log
- Message (from "user") - user turn with MessageContent
- Reasoning + ReasoningTrigger + ReasoningContent - collapsible thinking step
- Message (from "assistant") - assistant turn with markdown-ready MessageContent
- PromptInput + PromptInputBody + PromptInputTextarea - composer
- PromptInputFooter + PromptInputTools + PromptInputSubmit - actions row
Installation
npx gremorie@latest add block-chat-surfacepnpm dlx gremorie@latest add block-chat-surfaceyarn dlx gremorie@latest add block-chat-surfacebunx --bun gremorie@latest add block-chat-surfaceCode
'use client';
import {
Conversation,
ConversationContent,
Message,
MessageContent,
PromptInput,
PromptInputBody,
PromptInputFooter,
PromptInputSubmit,
PromptInputTextarea,
PromptInputTools,
Reasoning,
ReasoningContent,
ReasoningTrigger,
} from '@gremorie/rx-ai';
export function ChatSurface() {
return (
<div className="flex h-[560px] w-full flex-col overflow-hidden rounded-lg border bg-card">
<Conversation>
<ConversationContent className="px-4 py-6">
<Message from="user">
<MessageContent>What did the team ship this week?</MessageContent>
</Message>
<Message from="assistant">
<Reasoning isStreaming={false} duration={2}>
<ReasoningTrigger />
<ReasoningContent>
The user wants a quick weekly status summary. I'll group the
work into 3 buckets: shipped, in-flight, and blockers.
</ReasoningContent>
</Reasoning>
<MessageContent>{`Here is a quick weekly recap:
**Shipped**
- Auth flow with GitHub provider
- Dashboard analytics widget
**In flight**
- Settings form (3 sections)
- Empty state pattern`}</MessageContent>
</Message>
</ConversationContent>
</Conversation>
<div className="border-t bg-background p-3">
<PromptInput onSubmit={() => {}}>
<PromptInputBody>
<PromptInputTextarea placeholder="Ask anything..." />
<PromptInputFooter>
<PromptInputTools />
<PromptInputSubmit disabled />
</PromptInputFooter>
</PromptInputBody>
</PromptInput>
</div>
</div>
);
}Angular edition planned for Phase 5h. Star the repo to track progress.
Customization
- Wire
onSubmitto the AI SDK'ssendMessageor your streaming endpoint - Stream
Reasoningcontent whileisStreamingis true to get auto-collapse on completion - Add
PromptInputActionMenufor slash commands or attachment buttons - Swap
MessageContentforMessageResponse(Streamdown) when rendering server-streamed markdown