Agent Panel
A configurable agent side panel: docked or floating, left or right, card, page or glass surface, three entrance motions, and chat/voice modes.
Installation
Usage
import {
AgentPanel,
AgentPanelBody,
AgentPanelFooter,
AgentPanelHeader,
AgentPanelVoiceButton,
AgentPanelVoiceExit,
} from "@/components/ai/agent-panel"
<AgentPanel open={open} onOpenChange={setOpen} variant="floating" surface="glass">
<AgentPanelHeader title="Agent" icon="orb" />
<AgentPanelBody
chat={<Conversation>…</Conversation>}
voice={<><VoiceOrb … /><AgentPanelVoiceExit /></>}
/>
<AgentPanelFooter>
<PromptInput>
<PromptInputTextarea />
<PromptInputToolbar>
<PromptInputTools />
<AgentPanelVoiceButton />
<PromptInputSubmit />
</PromptInputToolbar>
</PromptInput>
</AgentPanelFooter>
</AgentPanel>API Reference
AgentPanel
| Prop | Type | Default |
|---|---|---|
open | boolean | – |
onOpenChangeEnables the close button. | (open: boolean) => void | – |
side | "left" | "right" | "right" |
variantDocked runs full height on an edge; floating is inset and rounded. | "docked" | "floating" | "docked" |
surfaceGlass blurs what is behind it. | "card" | "background" | "glass" | "card" |
widthIn px, capped to the available space. | number | 400 |
insetEdge gap when floating, in px. | number | 12 |
motionEntrance and exit. | "slide" | "fade" | "spring" | "spring" |
containedPosition inside the nearest positioned ancestor instead of the viewport. | boolean | false |
modeControlled mode. Or defaultMode with onModeChange. | "chat" | "voice" | – |
AgentPanelHeader
| Prop | Type | Default |
|---|---|---|
title | string | "Agent" |
icon"orb" shows a small live Voice Orb. | "sparkle" | "orb" | "none" | "sparkle" |
modesShows a chat/voice switch when there is more than one. | ("chat" | "voice")[] | – |
showClose | boolean | true |
AgentPanelVoiceButton
| Prop | Type | Default |
|---|---|---|
…Button propsEnters voice mode. Put it in the composer toolbar, next to send: the usual place, since people choose voice when they'd otherwise type. | ButtonProps | – |
AgentPanelVoiceExit
| Prop | Type | Default |
|---|---|---|
childrenReturns to chat. Put it in the voice view. | ReactNode | "End voice" |
AgentPanelBody
| Prop | Type | Default |
|---|---|---|
chatShown in chat mode. | ReactNode | – |
voiceShown in voice mode. The footer hides in voice mode. | ReactNode | – |