Skip to main content
Message bubble styling uses distinct CSS classes for incoming and outgoing messages. Each message type (text, image, video, audio, file, etc.) has predefined classes for default styling, customizable via CSS variable overrides.
Prerequisites before applying any CSS customization:
  1. Import the base stylesheet: @import url("@cometchat/chat-uikit-react/css-variables.css"); in your App.css
  2. Import your CSS file at the app entry: import "./App.css"; in App.tsx
  3. All selectors assume the UI Kit renders under a .cometchat root wrapper
  4. Use global CSS (not CSS Modules with hashed class names) — hashed selectors won’t match

Selector Pattern

Use this table to construct the correct CSS selector for any message bubble target. AI agents should use this pattern to generalize — do not guess selectors.
<TYPE><TYPE> is one of text, image, video, audio, file, delete, meeting (direct call), whiteboard, document, poll, sticker
Link Preview BubblesIt reuse the text-message type selector since link previews are rendered inside text messages.

CSS Variable Reference

These are the CSS variables (tokens) used across message bubble styling. This table tells you exactly what each token controls — do not assume a token affects something not listed here.
CSS Specificity & Precedence Rules:
  1. Message-type selectors (e.g., __text-message) override “All Message Bubbles” selectors
  2. Always keep the .cometchat prefix to avoid leaking styles into the host app
  3. Component-level variable overrides (.cometchat-message-list { --var: val }) override global overrides (.cometchat { --var: val })
  4. CSS variable overrides only affect properties the UI Kit theme binds to that variable — they do NOT change layout or spacing
  5. !important should never be needed — if it is, your selector specificity is wrong

Incoming & Outgoing Messages

Incoming and outgoing messages have different styling by default, allowing users to visually separate their own messages from others’. Here, we show both the default view and examples of customizations for these message bubbles. Shown below is the default chat interface.

Styling

Outgoing Message Bubbles

Selectors:
Tokens used: The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.
App.css
Expected result: All outgoing message bubbles change from purple to orange (#f76808) with a lighter orange shade (#fbaa75).

Incoming Message Bubbles

Selectors:
Tokens used: The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.
App.css
Expected result: All incoming message bubbles change from white/light to orange (#f76808).

All Message Bubbles

Selectors:
Tokens used: The customized chat interface is displayed below.
Use the following code to achieve the customization shown above.
App.css
Expected result: Both incoming and outgoing bubbles use orange (#f76808), with outgoing shade set to lighter orange (#fbaa75).

Complete End-to-End Example

To apply custom bubble colors in your app: Step 1: Add to App.css:
Step 2: Ensure App.tsx imports the CSS:
Expected result: Outgoing bubbles use orange (#f76808) with lighter shade (#fbaa75); incoming bubbles use light peach (#feede1).

Message Types

CometChat UI Kit includes classes for various message types. Below are examples of default & customised views for each message type, along with the relevant CSS code snippets so that you can quickly get up to speed with CSS customization.

Text Message Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing text bubbles change to orange (#f76808); incoming text bubbles change to light peach (#feede1).

Image Message Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing image bubbles change to orange (#f76808); incoming image bubbles change to light peach (#feede1).

Video Message Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing video bubbles change to orange (#f76808); incoming video bubbles change to light peach (#feede1).

Audio Message Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing audio bubbles change to orange (#f76808); incoming audio bubbles change to light peach (#feede1) with orange accent for playback controls.

File Message Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing file bubbles change to orange (#f76808); incoming file bubbles change to light peach (#feede1) with orange file icon accent.

Delete Message Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing delete placeholder bubbles change to orange (#f76808); incoming delete placeholder bubbles change to light peach (#feede1).

Action Message Bubble

Action messages (e.g., “User joined the group”) use a different selector pattern — they are not directional (no incoming/outgoing). Selector:
  • .cometchat .cometchat-message-bubble__body .cometchat-action-bubble
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Action message banners change to light peach background (#feede1) with orange text, icons, and borders (#f76808).

Direct Call Message Bubble

Direct call messages use the meeting-message type selector (not call-message). Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing direct call bubbles change to orange (#f76808) with lighter shade (#fbaa75); incoming direct call bubbles change to light peach (#feede1) with orange accent.

Default Call Message Bubble

Default call messages (ringing calls) use the same action bubble selector as Action Messages. Selector:
  • .cometchat .cometchat-message-bubble__body .cometchat-action-bubble
Tokens used:
Styling default call message bubbles also affects Action Message bubbles since they share the same .cometchat-action-bubble selector. To style them independently, use more specific parent selectors if available.
Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Default call action banners change to light peach background (#feede1) with orange text, icons, and borders (#f76808).

Extensions

Collaborative Whiteboard Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing whiteboard bubbles change to orange (#f76808); incoming whiteboard bubbles change to light peach (#feede1) with orange button and accent.

Collaborative Document Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing document bubbles change to orange (#f76808); incoming document bubbles change to light peach (#feede1) with orange button and accent.

Polls Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing poll bubbles change to orange (#f76808) with lighter progress bars (#fbaa75); incoming poll bubbles change to light peach (#feede1) with orange accent.

Stickers Bubble

Selectors:
Tokens used: Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing sticker bubbles change to orange (#f76808); incoming sticker bubbles change to light peach (#feede1).
Link previews render inside text message bubbles, so they use the text-message type selector. Selectors:
Tokens used:
Styling link preview bubbles also affects regular text message bubbles since they share the same __text-message selector. This is by design — link previews are a sub-feature of text messages.
Shown below is the default chat interface.
The customized chat interface is displayed below.
Complete CSS:
Expected result: Outgoing link preview bubbles change to orange (#f76808) with lighter shade (#fbaa75); incoming link preview bubbles change to light peach (#feede1) with orange secondary shade (#fbaa75).