āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/elevenlabs/ui/components/conversation ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
<ComponentPreview name="conversation-demo" description="A live scrolling conversation visualization." />
npx @elevenlabs/cli@latest components add conversation
</TabsContent>
<TabsContent value="manual">
<Steps>
<Step>Install the following dependencies:</Step>
npm install use-stick-to-bottom
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="conversation" title="components/ui/conversation.tsx" /><Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>import {
Conversation,
ConversationContent,
ConversationEmptyState,
ConversationScrollButton,
} from "@/components/ui/conversation"
<Conversation>
<ConversationContent>
{messages.map((message) => (
<div key={message.id}>{message.content}</div>
))}
</ConversationContent>
<ConversationScrollButton />
</Conversation>
<Conversation>
<ConversationContent>
{messages.length === 0 ? (
<ConversationEmptyState
title="No messages yet"
description="Start a conversation to see messages here"
/>
) : (
messages.map((message) => <div key={message.id}>{message.content}</div>)
)}
</ConversationContent>
<ConversationScrollButton />
</Conversation>
The main container component that manages scrolling behavior and sticky-to-bottom functionality.
Extends all props from StickToBottom component from use-stick-to-bottom.
| Prop | Type | Description |
| --------- | --------------- | ------------------------------------------- |
| className | string | Optional CSS classes |
| initial | "smooth" | Initial scroll behavior (default: "smooth") |
| resize | "smooth" | Resize scroll behavior (default: "smooth") |
| ...props | StickToBottom | All standard StickToBottom component props |
Container for conversation messages.
| Prop | Type | Description |
| --------- | ----------------------- | ------------------------------- |
| className | string | Optional CSS classes |
| ...props | StickToBottom.Content | All StickToBottom.Content props |
Displays when there are no messages in the conversation.
| Prop | Type | Description |
| ----------- | ---------------- | -------------------------------------------- |
| title | string | Title text (default: "No messages yet") |
| description | string | Description text |
| icon | ReactNode | Optional icon to display |
| className | string | Optional CSS classes |
| children | ReactNode | Custom content (overrides default rendering) |
| ...props | HTMLDivElement | All standard div element props |
A scroll-to-bottom button that appears when the user scrolls up.
| Prop | Type | Description |
| --------- | ------------- | ------------------------- |
| className | string | Optional CSS classes |
| ...props | ButtonProps | All standard Button props |
use-stick-to-bottom for smooth scrolling behaviorā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā