> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Customization When [``] doesn't fit the layout, drop down to the primitives. The widget itself is built from the same elements, wired together through reactive contexts. Three patterns, in increasing order of customization: 1. **Slots** — keep ``, replace one region (trigger or background). 2. **Events & methods** — attribute / event / method API; the widget still owns the lifecycle. 3. **Primitives** — drop the widget and compose ``, ``, ``, etc. directly. ## Slots [``] exposes a `background` slot for the full-bleed background and a default slot for the idle-state trigger. Anything in the default slot becomes the click target; clicking calls `widget.dial()`. ```html ``` Once dialing starts the widget swaps into call mode (inline or modal, per the `modal` attribute). ## Programmatic control [``] exposes `dial()` and `hangup()` for driving dialing from JS instead of the trigger slot: ```js const widget = document.querySelector("sw-call-widget"); document.querySelector("#dial-btn").addEventListener("click", async () => { try { await widget.dial(); } catch (err) { console.error("dial failed", err); } }); document.querySelector("#hangup-btn").addEventListener("click", () => { widget.hangup(); }); ``` The widget bubbles `sw-dial`, `sw-call-ended`, and forwarded agent events: ```js widget.addEventListener("sw-call-ended", (e) => { analytics.track("call_ended", { status: e.detail.status }); }); ``` See [``] for the full event surface. ## Pass-through attributes Widget attributes toggle sub-features: * `transcription` — enables the AI transcript drawer. * `allow-incoming-calls` — listens for inbound calls on the same token. * `audio-only` — skips the camera. * `user-variables` — JSON string forwarded into the Verto invite for the receiving side to read. See [``] for the full attribute list. ## Building from primitives For full layout control, compose the primitives directly. `` is the only required wrapper — it owns the reactive contexts that the SDK-aware components subscribe to. ```html
``` For the embed bundle, replace the imports with `const { SignalWire, StaticCredentialProvider } = SignalWireUI;` and drop `