Skip to main content
The UI Kit’s color palette uses CSS variables for consistent styling. Override these tokens on .cometchat or .cometchat-<component> to match your brand.
Prerequisites:
  1. Import the base stylesheet: @import url("@cometchat/chat-uikit-react/css-variables.css"); in App.css
  2. Import the CSS file at the app entry: import "./App.css"; in App.tsx
  3. All overrides must target .cometchat or a .cometchat-<component> class
  4. Use global CSS (not CSS Modules with hashed class names) — hashed selectors won’t match

Selector Contract

Canonical selector patterns for overriding colors. Global override
Component override
Dark mode override (app-controlled)
The source stylesheet defines dark mode defaults on [data-theme="dark"] at the :root level. When controlling dark mode from the app, place data-theme on the wrapper and scope overrides accordingly.

CSS Variable Reference

This table maps every commonly used token to what it visually controls.
CSS Specificity & Precedence Rules:
  1. Component-level overrides (.cometchat .cometchat-conversations { --var: val }) take precedence over global overrides (.cometchat { --var: val })
  2. Dark mode overrides ([data-theme="dark"]) take precedence over light mode defaults
  3. CSS variable overrides only affect properties the UI Kit theme binds to that variable — they do NOT change layout or spacing
  4. Always keep the .cometchat prefix to avoid leaking styles into the host app
  5. !important should never be needed — if it is, the selector specificity is wrong

Color Palette

The primary color defines key actions, branding, and UI elements, while the extended primary palette provides variations for supporting components.

Primary Color

Light Mode


Dark Mode

Extended Primary Colors

Light Mode

Dark Mode


Complete End-to-End Example: Custom Brand Colors

Step 1: Add to App.css:
Step 2: Ensure App.tsx imports the CSS:
Expected result: All primary-colored elements (outgoing bubbles, buttons, active states, links) change from purple (#6852D6) to orange (#f76808) in both light and dark modes.