Skip to main content

Overview

Most appearance settings — position, fonts, logo, dimensions, welcome message — are managed from the Dashboard and applied automatically when the widget loads. See Customization for the full list. When you use the npm SDK, you also get programmatic control over the widget’s colors and light/dark mode. This is useful when you want the widget to follow your site’s own theme toggle, or to brand it at runtime without touching the Dashboard.
Theme controls are part of the SDK handle returned by Zephlo.initialize(). They are not available through the plain script-tag (data-chatbot-id) integration.

Set colors and mode at init

Pass a theme option to Zephlo.initialize():

Theme option

Colors

Each mode accepts these optional colors. Anything you leave out falls back to a polished default.

Auto mode

With mode: "auto" (the default), the widget detects the host page’s theme and matches it. It checks, in order:
  1. A data-theme="dark" / data-theme="light" attribute on <html> or <body>
  2. A dark / light class on <html> (Tailwind, daisyUI, etc.)
  3. The CSS color-scheme property
  4. The visitor’s OS preference (prefers-color-scheme)
The widget also reacts to changes — if your site toggles its theme class at runtime, the widget switches with it. No extra code required.

Change the theme at runtime

The handle exposes live properties. Assigning to them re-styles every mounted view immediately.

Update a mode without switching to it

Use setColors(mode, colors) to change colors for light or dark mode without making it active:

Follow your site’s theme toggle

A common pattern: keep the widget in sync with your own light/dark switch.
If you’d rather let the widget track your page automatically, leave it in auto mode and just toggle your page’s data-theme or .dark class — the widget follows along.

Next steps

Widget integration

Embedding options and Dashboard customization.

Proactive triggers

Have the agent reach out to visitors first.