Skip to content

Sizing & Layout

Dimensions

Control the widget size with the height and width attributes:

html
<saytv-chat
  app-id="your-app-id"
  height="700"
  width="450px"
></saytv-chat>
AttributeTypeDefaultDescription
heightnumber850Height in pixels
widthstring'450px'Width as any CSS value

CSS Variables

You can also control dimensions through CSS custom properties:

PropertyDefaultDescription
--stv-widget-width450pxWidget width
--stv-widget-height850pxWidget height
--stv-widget-min-height600pxMinimum height
--stv-widget-max-width1280pxMaximum width
--stv-widget-border-radius16pxWidget corner radius
--stv-header-height54pxHeader bar height
--stv-footer-height56pxFooter nav height
--stv-input-height44pxInput field height

Full-Width Layout

To make the widget fill its container:

html
<saytv-chat
  app-id="your-app-id"
  width="100%"
  height="700"
></saytv-chat>

Responsive Container

Wrap the widget in a responsive container:

html
<div style="max-width: 500px; margin: 0 auto;">
  <saytv-chat
    app-id="your-app-id"
    width="100%"
    height="700"
  ></saytv-chat>
</div>

Full-Page Chat

For a full-viewport chat experience:

html
<style>
  html, body { margin: 0; padding: 0; height: 100%; }
  .chat-fullpage { width: 100%; height: 100vh; }
</style>

<div class="chat-fullpage">
  <saytv-chat
    app-id="your-app-id"
    width="100%"
    style="--stv-widget-height: 100vh; --stv-widget-border-radius: 0;"
  ></saytv-chat>
</div>

TIP

When using 100vh, set --stv-widget-border-radius: 0 to remove the widget's corner rounding for a flush full-page look.

Container Queries

The widget automatically adapts its layout based on the available width. You don't need to configure anything - it adjusts its UI at different sizes.

Avatar Sizes

PropertyDefaultDescription
--stv-avatar-size-sm28pxSmall avatars (message list)
--stv-avatar-size-md36pxMedium avatars (headers)
--stv-avatar-size-lg56pxLarge avatars (profiles)
--stv-avatar-size-xl80pxExtra large avatars (profile page)

SayTV Chat SDK Documentation