For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReferenceClick-to-Call
GuidesReferenceClick-to-Call
  • Core
    • Overview
  • Entities
    • SignalWire
    • Address
    • Participant
    • ClientPreferences
    • SelfCapabilities
    • SelfParticipant
    • User
    • WebRTCCall
  • Web Components
    • Overview
    • sw-audio-level
    • sw-call-controls
    • sw-call-dialpad
    • sw-call-media
    • sw-call-provider
    • sw-call-status
    • sw-call-widget
    • sw-click-to-call
    • sw-device-selector
    • sw-directory
    • sw-local-camera
    • sw-participant-controls
    • sw-participants
    • sw-self-media
    • sw-ui-alert
    • sw-ui-background
    • sw-ui-call-layout
    • sw-ui-content-drawer
    • sw-ui-control-bar
    • sw-ui-dialpad
    • sw-ui-dropup
    • sw-ui-icon
    • sw-ui-modal
    • sw-ui-responsive-container
    • sw-ui-split-button
    • sw-ui-transcript-view
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • class: SwUiContentDrawer, sw-ui-content-drawer
  • Fields
  • open
  • narrow
  • title
  • content
  • format
  • language
  • Attributes
  • CSS Properties
  • CSS Parts
  • Events
Web Components

sw-ui-content-drawer

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

sw-ui-control-bar

Next
Built with

Slide-in drawer that displays rich content the agent pushed mid-call (a snippet, a markdown article, a sanitized HTML fragment, or plain text) without leaving the call view.

1<sw-ui-content-drawer open>
2 <h2>Article</h2>
3 <p>Rich content pushed from the agent appears here.</p>
4</sw-ui-content-drawer>

Used by <sw-call-widget> to render display_content user events from the AI agent. The drawer auto-orients itself to the available space:

  • Wide containers — slides in from the right at ~360 px wide.
  • Narrow containers (parent ≤ 480 px) — slides up from the bottom at ~50 % container height for better mobile ergonomics.

Four content formats are supported, each with appropriate sanitisation:

  • text — rendered verbatim with whitespace preserved.
  • markdown — parsed via marked, sanitised via DOMPurify with a strict tag/attribute allowlist; target="_blank" links are rewritten with rel="noopener noreferrer".
  • code — highlighted via Prism; the language must be supplied in payload.language and is loaded lazily.
  • html — passed through DOMPurify with the same allowlist as markdown.

Class: SwUiContentDrawer · Module: packages/web-components/src/components/UI/layout/sw-ui-content-drawer.ts

class: SwUiContentDrawer, sw-ui-content-drawer

Fields

open
booleanDefaults to false

open field.

narrow
booleanDefaults to false

narrow field.

title
stringDefaults to ''

title field.

content
stringDefaults to ''

content field.

format
ContentFormatDefaults to 'text'

format field.

language
stringDefaults to ''

language field.

Attributes

NameFieldInherited From
openopen
narrownarrow
titletitle
contentcontent
formatformat
languagelanguage

CSS Properties

NameDefaultDescription
--bg-pageDrawer background.
--fg-defaultPrimary text color.
--border-defaultHeader divider color.
--shadow-mdDrawer drop shadow.
--radius-mdDrawer corner rounding (only the visible edges).
--type-family-bodyBody font family.
--type-size-smallBody font size.

CSS Parts

NameDescription
containerOuter drawer container.
headerSticky header (title + close button).
titleTitle heading.
closeClose-button anchor.
bodyScrollable content body.

Events

NameDetailDescription
sw-content-drawer-close—User clicked the close button. No detail.