Call Controls
Controls for a realtime voice session: status and timer, mute, interrupt the agent, end the call.
Connecting
Installation
pnpm dlx shadcn@latest add @jds/call-controls
Usage
import { CallControls, CallEnd, CallInterrupt, CallMute, CallStatus } from "@/components/voice/call-controls"
<CallControls>
<CallStatus state="connected" startedAt={startedAt} />
<CallMute onPressedChange={setMuted} />
<CallInterrupt disabled={!agentSpeaking} onClick={interrupt} />
<CallEnd onClick={hangUp} />
</CallControls>API Reference
CallStatus
| Prop | Type | Default |
|---|---|---|
state | "connecting" | "connected" | "reconnecting" | "ended" | – |
startedAtEpoch ms. Shows elapsed time while connected. | number | – |
CallMute
| Prop | Type | Default |
|---|---|---|
pressedMuted. Or use defaultPressed with onPressedChange. | boolean | – |