BVector by BangDBBVector
BVector Chat

Theming

Pass a colorTokensobject to override any of the 16 CSS design tokens used inside the widget's Shadow DOM.

How theming works

Because the widget lives inside a Shadow DOM, it has its own CSS scope. BVector Chat exposes 16 semantic color tokens as CSS custom properties within that scope. You map your brand colors to these tokens via the colorTokens option — no CSS files, no class overrides needed.

Tokens accept any valid CSS color value: hex, rgb, hsl, oklch, or CSS custom properties from the outer page scope (e.g. var(--brand-color)).

Available tokens

TokenDescription
backgroundMain widget background color
foregroundPrimary text color
primaryPrimary action / button color
primaryForegroundText color on primary elements
secondarySecondary action color
secondaryForegroundText color on secondary elements
accentAccent / highlight color
accentForegroundText color on accent elements
mutedMuted / subdued surface color
mutedForegroundText color on muted surface
cardCard and panel background
cardForegroundText inside cards and panels
borderBorder color throughout the widget
inputInput field background color
ringFocus ring color
borderRadiusBase corner radius, e.g. "8px" or "0px"

Dark theme example

example.tsx
new ChatWidget({
  title: 'Support Chat',
  config: { /* your ApiConfig */ },
  colorTokens: {
    background: '#0a0a0a',
    foreground: '#f8f8f2',
    primary: '#00b4ff',
    primaryForeground: '#ffffff',
    accent: '#00b4ff',
    border: 'rgba(255, 255, 255, 0.1)',
    borderRadius: '8px',
  },
});

Light theme example

example.tsx
new ChatWidget({
  title: 'Support Chat',
  config: { /* your ApiConfig */ },
  colorTokens: {
    background: '#ffffff',
    foreground: '#111110',
    primary: '#111110',
    primaryForeground: '#ffffff',
    muted: '#f3f3f2',
    mutedForeground: '#5c5c59',
    border: '#e5e5e2',
    borderRadius: '12px',
  },
});

🍪 Cookie Notice

We use cookies to ensure that we give you the best experience on our website. Read cookies policies.