Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-react-uikit-v7.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
| Field | Value |
|---|---|
| Theme prop | theme="light" or theme="dark" on CometChatProvider |
| CSS import | import "@cometchat/chat-uikit-react/styles"; |
| Root selector | .cometchat (wrapper div with data-theme attribute) |
| Token prefix | --cometchat-* |
| Built-in themes | light (default), dark |
| Custom theme | Override CSS variables on .cometchat or [data-theme="custom"] |
Overview
The v7 UI Kit uses CSS custom properties (design tokens) for all visual styling. Every color, font, spacing value, and border radius is defined as a--cometchat-* variable. Components reference these tokens — never hardcoded values.
Theming works through the data-theme attribute on the .cometchat wrapper div. The built-in light.css and dark.css files define token values for each theme. You can override any token to create custom themes.
Setting the Theme
Pass thetheme prop to CometChatProvider:
data-theme="dark" on the wrapper, which activates the dark theme CSS variables.
Switching Themes at Runtime
Use theuseTheme hook inside any component within the provider:
Customizing Tokens
Override CSS variables to change the look of all components at once:src/cometchat-overrides.css
Per-Theme Overrides
Target a specific theme with thedata-theme selector:
Per-Component Overrides
Target a specific component by its BEM class name:Design Token Categories
Colors
| Token | Purpose |
|---|---|
--cometchat-primary-color | Brand color (buttons, links, highlights) |
--cometchat-extended-primary-color-50 to 900 | Primary color scale (50 = lightest) |
--cometchat-neutral-color-50 to 900 | Gray scale for backgrounds, borders, text |
--cometchat-info-color | Informational (blue) |
--cometchat-warning-color | Warning (amber) |
--cometchat-success-color | Success (green) |
--cometchat-error-color | Error (red) |
--cometchat-static-black | Always black regardless of theme |
--cometchat-static-white | Always white regardless of theme |
Semantic Colors
| Token | Purpose |
|---|---|
--cometchat-background-color-01 to 04 | Background layers (01 = base, 04 = elevated) |
--cometchat-border-color-light / default / dark / highlight | Border variants |
--cometchat-text-color-primary / secondary / tertiary / disabled / highlight | Text colors |
--cometchat-icon-color-primary / secondary / tertiary / highlight | Icon colors |
Typography
| Token | Value format |
|---|---|
--cometchat-font-family | Font stack (default: 'Roboto', 'Inter', sans-serif) |
--cometchat-font-title-bold | 700 32px/38.4px var(--cometchat-font-family) |
--cometchat-font-heading1-bold through heading4-regular | Heading scales |
--cometchat-font-body-bold / medium / regular | Body text (14px) |
--cometchat-font-caption1-bold / medium / regular | Small text (12px) |
--cometchat-font-caption2-bold / medium / regular | Smallest text (10px) |
Spacing & Layout
| Token | Purpose |
|---|---|
--cometchat-spacing to --cometchat-spacing-20 | Spacing scale (2px increments: 2, 4, 8, 12, 16, …, 80) |
--cometchat-padding to --cometchat-padding-10 | Padding (maps to spacing) |
--cometchat-margin to --cometchat-margin-20 | Margin (maps to spacing) |
--cometchat-radius to --cometchat-radius-6 | Border radius scale |
--cometchat-radius-max | Fully rounded (1000px) |
Buttons
| Token | Purpose |
|---|---|
--cometchat-primary-button-background | Primary button background |
--cometchat-primary-button-text | Primary button text color |
--cometchat-primary-button-icon | Primary button icon color |
--cometchat-secondary-button-background | Secondary button background |
--cometchat-secondary-button-text | Secondary button text color |
--cometchat-fab-button-background | Floating action button background |
Component CSS Classes
The UI Kit uses plain, unhashed BEM class names in the DOM. All component class names follow the patterncometchat-{component} with BEM modifiers (e.g., cometchat-message-bubble__content--outgoing). You can target them directly with standard class selectors.
What Works
1. The.cometchat wrapper class — the root div. Override tokens here to affect all components:
CSS variable overrides work at any level of the tree. Set them on
.cometchat (the root wrapper) to affect all components, or use class selectors / wrapper classes to scope the change. Variables cascade down — a value set on a parent will be inherited by all CometChat components within it.Creating a Custom Theme
Define a complete set of tokens under a customdata-theme value:
src/themes/brand.css
When creating a custom theme, start from the light or dark theme file and override only what you need. Unset tokens will fall back to the
:root defaults (light theme).Next Steps
Color Resources
Full color token reference with swatches
Message Bubble Styling
Customize bubble appearance, alignment, and spacing