JDS.

Search docs

Find a page or component

Call Controls

Controls for a realtime voice session: status and timer, mute, interrupt the agent, end the call.

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

PropTypeDefault
state"connecting" | "connected" | "reconnecting" | "ended"–
startedAt

Epoch ms. Shows elapsed time while connected.

number–

CallMute

PropTypeDefault
pressed

Muted. Or use defaultPressed with onPressedChange.

boolean–