Getting Started
Components
- Agent Status
- Agent Template Card
- API Key Card
- Audio Player
- Bar Visualizer
- Channel Status Card
- Chat Composer
- Code Editor
- Condition Builder
- Confirm Dialog
- Conversation
- Conversation Bar
- Dataset Card
- Document Status Badge
- Extraction Strategy Select
- File Icon
- File Upload
- Indexing Progress
- Live Waveform
- Matrix
- Message
- Mic Selector
- Model Diff View
- Model Selector
- Model Type Filter
- Node Catalog
- Option Editor
- Orb
- Output Variables View
- Package Card
- Prompt Editor
- Provider Status Card
- Radio Card
- Resource Card
- Resource Sidebar
- Response
- Run Node List
- Scrub Bar
- Segment Card
- Shimmering Text
- Speech Input
- Token Trend Chart
- Tool Call Card
- Transcript Viewer
- Usage Stat Card
- Variable Binding Editor
- Variable Selector
- Voice Button
- Voice Picker
- Waveform
- Workflow Node Card
- Workspace Selector
ZGI Agent
"use client"
import { ConversationProvider } from "@elevenlabs/react"
import { ConversationBar } from "@/components/ui/conversation-bar"
const DEFAULT_AGENT = {
agentId: process.env.NEXT_PUBLIC_ELEVENLABS_AGENT_ID!,
}
export function ConversationBarDemo() {
return (
<ConversationProvider>
<div className="flex min-h-[200px] w-full items-center justify-center">
<div className="w-full max-w-md">
<ConversationBar agentId={DEFAULT_AGENT.agentId} />
</div>
</div>
</ConversationProvider>
)
}
Installation
pnpm dlx shadcn@latest add https://ui.zgi.ai/r/conversation-bar.json
Usage
This component requires a configured voice agent ID from your realtime conversation provider.
import { ConversationBar } from "@/components/ui/conversation-bar"Basic Usage
<ConversationBar
agentId="your-agent-id"
onConnect={() => console.log("Connected")}
onDisconnect={() => console.log("Disconnected")}
onMessage={(message) => console.log("Message:", message)}
onError={(error) => console.error("Error:", error)}
/>With Custom Styling
<ConversationBar
agentId="your-agent-id"
className="max-w-2xl"
waveformClassName="bg-primary"
onConnect={() => console.log("Connected")}
/>API Reference
ConversationBar
A complete voice conversation interface with WebRTC support, microphone controls, text input, and real-time waveform visualization.
Props
| Prop | Type | Description |
|---|---|---|
| agentId | string | Required. Voice agent ID to connect to |
| className | string | Optional CSS classes for the container |
| waveformClassName | string | Optional CSS classes for the waveform |
| onConnect | () => void | Callback when conversation connects |
| onDisconnect | () => void | Callback when conversation disconnects |
| onError | (error: Error) => void | Callback when an error occurs |
| onMessage | (message: { source: "user" | "ai"; message: string }) => void | Callback when a message is received |
Features
- Voice Input: Connect to realtime voice agents via WebRTC for live conversations
- Text Input: Expandable keyboard input with contextual updates
- Microphone Controls: Mute/unmute toggle with visual feedback
- Live Waveform: Real-time audio visualization during conversations
- Connection States: Visual feedback for disconnected, connecting, connected, and disconnecting states
- Keyboard Shortcuts: Enter to send messages, Shift+Enter for new lines
- Responsive Design: Works seamlessly across desktop and mobile devices
Notes
- Uses the
@elevenlabs/reactpackage for the default conversation provider integration - Uses WebRTC for real-time audio streaming
- Automatically requests microphone permissions when starting a conversation
- Cleans up media streams on component unmount
- Text input sends contextual updates to the agent while typing
- The waveform visualizes microphone input in real-time when connected and unmuted
Deploy and Scale Agents with ZGI
ZGI delivers the infrastructure and developer experience you need to ship reliable audio & agent applications at scale.
Talk to an expert