Skip to main content
The UI Kit’s color palette uses theme tokens for consistent styling. Override these tokens via CometChatThemeProvider to match your brand.
Prerequisites:
  1. Wrap your app with CometChatThemeProvider
  2. Colors must be supplied as hex values (e.g., #F76808)
  3. Extended primary colors auto-generate from primary unless explicitly overridden

Color Token Reference

This table maps every commonly used token to what it visually controls.

Overview

Colors in CometChatTheme allow you to maintain a consistent visual identity across your application by providing predefined colors for various UI elements, such as text, buttons, backgrounds, alerts, and more. These color definitions seamlessly adapt to both light and dark themes, ensuring an optimal user experience across different modes. The color resources are divided into the following categories:
  • Primary Colors: Define the main theme of the application.
  • Neutral Colors: Used for backgrounds, borders, and secondary UI elements.
  • Alert Colors: Highlight states like success, warning, error, or information.
  • Text Colors: Used for typography.
  • Icon Colors: Define icon appearances.
  • Button Colors: Customize button backgrounds, icons, and text.
CometChat provides separate color definitions for light mode and dark mode, enabling automatic theme adaptation.

Usage

Default Colors

CometChat provides predefined color sets for both light and dark modes, ensuring optimal visual contrast and accessibility across your application. These colors can be accessed through the theme value, which is obtained using the useTheme() hook. Example: Colors
Extended colors 50-100 are generated based on the following blend percentages.
For more details on how other colors are generated, click here.
Extended primary colors, as well as background, text, button, and other UI colors, are automatically derived from the provided primary and neutral colors. However, any colors explicitly overridden in the theme via CometChatThemeProvider will take precedence over the generated values.

Customizing Colors

You can override the default colors to align them with your application’s branding.
Colors must be supplied as hex values.
Example: Changing the primary and textPrimary colors.
To learn more about the theme structure, visit the theme interface.

Next Steps

Introduction to Theming

Learn how CometChatThemeProvider manages light and dark modes

Message Bubble Styling

Style individual message bubbles and their content

Localize

Translate UI strings and support multiple languages

Components Overview

Explore all available UI Kit components