sw-call-status

View as MarkdownOpen in Claude

Compact status pill that mirrors the live call state plus a running duration timer once the call is connected.

1<sw-call-provider token="YOUR_GUEST_TOKEN">
2 <sw-call-status></sw-call-status>
3</sw-call-provider>

Subscribes to call.status$ (or to callStateContext.status when nested inside <sw-call-provider> / <sw-call-widget>) and renders three pieces of UI:

  1. A circular status indicator dot whose color/animation reflects the current state — pulsing yellow for connecting/ringing/trying/ recovering, solid green for connected, pulsing red for disconnecting, solid red for disconnected/failed, gray for new/destroyed.
  2. A status label, mapped from the SDK’s CallStatus enum to a human-readable string (“Connecting…”, “Ringing…”, “Connected”, …).
  3. A monospace M:SS (or H:MM:SS) duration counter that starts when the call enters connected and resets when it leaves.

Input precedence (most specific wins): .call > context. The label uses aria-live="polite" so screen readers are notified of state transitions without interrupting the user.

Class: SwCallStatus · Module: packages/web-components/src/components/sw-call-status.ts

class: SwCallStatus, sw-call-status

Fields

call
Call | undefined

Explicit Call — when set, subscribes directly to its observables and bypasses context.

Attributes

NameFieldInherited From
callcall

CSS Properties

NameDefaultDescription
--type-family-bodyFont family inherited from the design tokens.
--type-size-smallFont size for the label.
--radius-mdBorder radius of the container pill.
--fg-defaultDefault label color.
--bg-surface-raisedIndicator color in idle states (`new`, `destroyed`).
--interactive-status-successColor used while connected.
--interactive-status-warningColor used during connection / recovery.
--interactive-button-destructive-bgColor used for failure / disconnect states.

CSS Parts

NameDescription
containerOuter pill that wraps the indicator, label, and timer.
status-textThe text label (`role=“status”`, `aria-live=“polite”`).
durationThe running timer (only rendered while `connected`).