Live Call Card
ProNewA call in progress: who is on the line, a steady timer, bars that move for whoever is speaking, and controls to mute, hold, transfer and end.
Installation
pnpm dlx shadcn@latest add @viewport/live-call-card
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| caller* | stringWho is on the line. | — |
| detail | stringA second line, e.g. the number or what the call is about. | — |
| agent* | stringThe agent handling the call. | — |
| status* | "ringing" | "live" | "hold" | "ended" | — |
| speaking | "agent" | "caller" | nullWho is speaking now. Their bars move; the other side's rest. | null |
| startedAt | numberWhen the call was answered, as a timestamp in milliseconds. The timer counts from it. | — |
| muted | boolean | false |
| onMuteChange | (muted: boolean) => void | — |
| onHoldChange | (held: boolean) => void | — |
| onTransfer | () => void | — |
| onEnd | () => void | — |
| className | string | — |
Accessibility
- Status is a word and a dot; it is announced when it changes.
- Controls are a named toolbar; toggles report aria-pressed.
- Controls that do not apply are disabled, not removed, so nothing shifts.
- Bars rest and the status ring is still under reduced motion.