Conversation
Real-time conversation display component with message history and text input
The Conversation component displays real-time conversation history between users and AI assistants. It automatically integrates with the Pipecat Client SDK to show messages, connection states, and provides smooth scrolling behavior.
import { Conversation, ConversationProvider } from "@pipecat-ai/voice-ui-kit";
<ConversationProvider>
<div className="h-96 border rounded-lg">
<Conversation />
</div>
</ConversationProvider>| Prop | Type | Default |
|---|---|---|
classNames? | { container?: string; message?: string; messageContent?: string; role?: string; time?: string; thinking?: string; } | {} |
noAutoscroll? | boolean | false |
assistantLabel? | string | "assistant" |
clientLabel? | string | "user" |
systemLabel? | string | "system" |
textMode? | "llm" | "tts" | "llm" |
noTextInput? | boolean | false |
Connection States
The component displays different UI based on connection state:
- No messages, connecting: Shows "Connecting to agent..." message
- No messages, not connected: Shows "Not connected to agent" message with description
- No messages, connected: Shows "Waiting for messages..." message
- Has messages: Displays message list with scrolling
Scrolling Behavior
The component implements smart scrolling:
- Automatically scrolls to bottom when new messages arrive
- Only scrolls if the user is already at the bottom (doesn't interrupt reading)
- Tracks scroll position to determine if user is at bottom
- Respects
noAutoscrollprop to disable automatic scrolling entirely
Integration
The Conversation component uses:
usePipecatConversationhook to get messages from the conversation storeusePipecatClientTransportStateto determine connection stateMessageContainerandMessageContentcomponents to render individual messagesTextInputcomponent for user input
It must be used within:
PipecatClientProvidercontext (for transport state)ConversationProvidercontext (for message store)