Brand the Support widget with CSS variables, the theme prop, and your app tokens.

You can make the widget feel like part of your product without replacing any components.

Use this when

  • the default widget shape is good and you mainly need branding
  • you want a copy-paste way to set colors and radius
  • you want the widget to follow your app theme or force light or dark mode

Smallest working change

Set the widget tokens once and keep the default UI.

csssrc/index.css
.cossistant {
  --co-theme-primary: #111827;
  --co-theme-primary-foreground: #ffffff;
  --co-theme-background: #ffffff;
  --co-theme-foreground: #111827;
  --co-theme-border: #e5e7eb;
  --co-theme-radius: 0px;
}

That is usually enough to make the widget feel like yours.

Common variants

Force light or dark mode

import { Support } from "@cossistant/react";
 
<Support theme="dark" />;

By default, the widget follows your app theme. It checks for .dark or data-color-scheme="dark" on parent elements.

Reuse your shadcn tokens

:root {
  --co-theme-background: var(--background);
  --co-theme-foreground: var(--foreground);
  --co-theme-primary: var(--primary);
  --co-theme-primary-foreground: var(--primary-foreground);
  --co-theme-border: var(--border);
  --co-theme-radius: var(--radius);
}

This keeps the widget aligned with the rest of your app instead of inventing a second theme.

When to stop here

  • colors, radius, and dark mode are enough
  • you want the default layout to stay in place
  • you do not need custom pages or a custom shell

Next step

  • Pages & Layouts when you need a different first screen, an inline embed, or your own shell
  • Copy & Locale when the next change is wording instead of UI

Core token reference

VariableLight previewDefault (Light)Dark previewDefault (Dark)
--co-theme-backgroundoklch(99% 0 0)oklch(15.5% 0 0)
--co-theme-foregroundoklch(20.5% 0 0)oklch(95% 0 0)
--co-theme-primaryoklch(14.5% 0 0)oklch(98.5% 0 0)
--co-theme-primary-foregroundoklch(98.5% 0 0)oklch(14.5% 0 0)
--co-theme-borderoklch(92.2% 0 0)oklch(26.9% 0 0)
--co-theme-mutedColor-mixedColor-mixed
--co-theme-muted-foregroundColor-mixedColor-mixed
--co-theme-radius-0.375rem-0.375rem

Extra tokens

Use these when the core tokens are not enough:

Status colors

VariableLight previewDefault (Light)Dark previewDefault (Dark)
--co-theme-destructiveoklch(57.7% 0.245 27.325)oklch(39.6% 0.141 25.723)
--co-theme-successoklch(71.7% 0.18 142)oklch(60% 0.15 142)
--co-theme-warningoklch(86.4% 0.144 99)oklch(90.3% 0.111 99)
--co-theme-neutraloklch(60.8% 0 0)oklch(50% 0 0)

Avatar accents

VariableLight previewDefault (Light)Dark previewDefault (Dark)
--co-theme-pinkoklch(76.3% 0.152 354)oklch(84.2% 0.109 354)
--co-theme-yellowoklch(86.4% 0.144 99)oklch(90.3% 0.111 99)
--co-theme-blueoklch(72.5% 0.132 241)oklch(79.8% 0.089 241)
--co-theme-orangeoklch(74.5% 0.166 50)oklch(68.2% 0.194 50)

Background shades

VariableLight previewDefault (Light)Dark previewDefault (Dark)
--co-theme-background-50Color-mixedColor-mixed
--co-theme-background-100Color-mixedColor-mixed
--co-theme-background-200Color-mixedColor-mixed
--co-theme-background-300Color-mixedColor-mixed

The background shades are derived from your base colors with color-mix() unless you override them directly.