Skip to main content
The Angular UIKit uses a CSS variable-based theming system. There are no theme objects or style input props — all customization is done by overriding CSS variables in your global stylesheet.

How It Works

All design tokens are defined as CSS custom properties on :root in the UIKit’s css-variables.css. You override them in your own global CSS file to apply your brand.

Light / Dark Mode

Dark mode is activated by setting the data-theme="dark" attribute on the <html> element:
You can also call setTheme or toggleTheme directly:
MethodDescription
setTheme(theme)Set 'light' or 'dark'
toggleTheme()Flip between light and dark
SSR Note: Always use Angular’s DOCUMENT injection token instead of document directly.

Customizing Colors

Override variables in your global stylesheet (styles.css or styles.scss):

Typography

Available font scale variables:
VariableWeightSize
--cometchat-font-heading1-bold70024px
--cometchat-font-heading2-bold70020px
--cometchat-font-body-regular40014px
--cometchat-font-body-medium50014px
--cometchat-font-caption1-regular40012px

Spacing & Border Radius

Component-Level Scoping

To override styles for a specific instance, scope the variable override to that element’s selector:

Shadows & Overlays

Avatars & Badges

Status Indicators

Complete Custom Theme Example

Sound Manager

CometChatSoundManager manages audio cues for incoming/outgoing calls and messages. Sound is a frozen object on CometChatSoundManager — access event keys via CometChatSoundManager.Sound.

Sound Events

Event KeyWhen it plays
incomingCallIncoming call detected
outgoingCallOutgoing call initiated
incomingMessageNew message from the current conversation
incomingMessageFromOtherNew message from a different conversation
outgoingMessageMessage sent

Methods

MethodDescription
play(sound, customSound?)Play default or custom audio for a sound event
pause()Pause the currently playing sound and reset position
onIncomingMessage(customSound?)Play incoming message sound directly
onIncomingOtherMessage(customSound?)Play incoming other message sound directly
onOutgoingMessage(customSound?)Play outgoing message sound directly
onIncomingCall(customSound?)Play incoming call sound (loops)
onOutgoingCall(customSound?)Play outgoing call sound (loops)
hasInteracted()Returns boolean — whether user has interacted with the page (required by browser autoplay policies)

Usage


Design Token Pipelines

If your team uses a design token pipeline (e.g. Style Dictionary, Theo), you can generate the CSS variable overrides as a build artifact and import the output file in styles.css. The UIKit’s variable names follow a consistent --cometchat-{category}-{scale} pattern that maps cleanly to token schemas.

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


Full Variable Reference

Colors

VariableDefault (Light)Purpose
--cometchat-primary-color#6852D6Buttons, highlights, badges
--cometchat-neutral-color-900#141414Primary text
--cometchat-neutral-color-600#727272Secondary text
--cometchat-neutral-color-50#FFFFFFBase background
--cometchat-error-color#F44649Error states
--cometchat-success-color#09C26FSuccess states
--cometchat-warning-color#FFAB00Warning states
--cometchat-info-color#0B7BEAInfo states

Semantic Aliases

VariableMaps To
--cometchat-text-color-primary--cometchat-neutral-color-900
--cometchat-text-color-secondary--cometchat-neutral-color-600
--cometchat-background-color-01--cometchat-neutral-color-50
--cometchat-background-color-02--cometchat-neutral-color-100
--cometchat-border-color-default--cometchat-neutral-color-300
--cometchat-primary-button-background--cometchat-primary-color