Theme Options
| Theme | Description |
|---|---|
light | Always use light mode with white backgrounds |
dark | Always use dark mode with dark backgrounds |
system | Auto-detect based on visitor’s system preference (default) |
Configuring Theme in Dashboard
- Go to your agent’s Embed page
- Under Appearance, find the Theme dropdown
- Select your preferred theme:
- Light — Forces light mode
- Dark — Forces dark mode
- System (auto-detect) — Matches visitor’s OS preference
New agents default to System theme, which automatically adapts to your visitors’ light/dark mode preference.
How System Theme Detection Works
When theme is set tosystem, the widget:
- Checks the visitor’s OS preference using
prefers-color-schememedia query - Listens for real-time changes (e.g., when user toggles system dark mode)
- Automatically updates the widget appearance without page refresh
JavaScript API
You can control the widget theme programmatically using JavaScript:Set Theme
Get Current Theme
Example: Sync with Website Theme Toggle
Example: Match Website Theme on Load
Dark Mode Colors
When in dark mode, the widget uses these colors:| Element | Light Mode | Dark Mode |
|---|---|---|
| Background | #ffffff | #111827 |
| Text | #1f2937 | #f3f4f6 |
| Borders | #e5e7eb | #374151 |
| Input background | #f9fafb | #1f2937 |
| Assistant bubbles | #f6f9fc | #374151 |
Best Practices
Use System for Best UX
Use System for Best UX
The
system theme provides the best user experience as it respects visitors’ preferences. Many users enable dark mode system-wide, and matching this preference reduces eye strain.Match Your Website
Match Your Website
If your website has a fixed light or dark theme, set the widget to match. Use
setTheme() if your website has a theme toggle.Test Both Modes
Test Both Modes
Always preview your widget in both light and dark modes to ensure your branding colors (primary color, chat bubble color) look good in both contexts.
Consider Contrast
Consider Contrast
If using a very light primary color, it will automatically use dark text for contrast. The widget handles this automatically.