Click-to-Call Widget
Click-to-Call Widget
Click-to-Call Widget
<sw-click-to-call> is a single-button call element. With a
token and a destination, it renders a styled button that dials
the configured destination and opens the full call UI in a modal.
Under the hood it’s a thin wrapper around <sw-call-widget>
configured in modal mode — the button is the trigger; media,
controls, and the optional AI transcript are delegated to the widget
once the user clicks.
One script tag, one element:
For bundler-based projects, swap the script tag for
import "@signalwire/web-components/sw-click-to-call". The element
markup is identical. See Overview
for the two pathways.
token accepts two formats:
c2c_… / c2t_… prefix) — created from a
Click to Call resource in
the dashboard (sidebar → Tools → Click to Call). The
destination is pinned in the resource configuration; the
destination attribute is ignored when the embed token already
pins one. The widget routes through embeds.signalwire.com
automatically.destination.For public pages, prefer the embed token: it’s safe to expose in HTML, scoped to a single destination, and revocable from the dashboard. Use a SAT when the visitor is signed into your app and the call should be attributed to their account. See Authentication.
token is required. destination selects the resource to dial
(ignored when the embed token already pins one). label sets the
button text. audio-only skips video. See
<sw-click-to-call> for the full attribute list.
The element bubbles three composed events:
sw-dial — dialing startedsw-call-hangup — the visitor clicked hangupsw-call-ended — the call reached any terminal stateThe button reads from the SignalWire DTCG tokens shipped in
theme.css. Override them at any ancestor to restyle without
piercing shadow DOM:
For finer control, target the inner button via its
CSS Part:
See Theming for the full token list and brand-color recipes.
<sw-call-widget> instead<sw-click-to-call> is single-destination, button-only, modal-only.
Use <sw-call-widget> directly for any of:
<sw-call-widget>).allow-incoming-calls).dial() / hangup() control.Both share the same underlying call lifecycle — see
<sw-call-widget> for the full surface.