Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Design & UI

cometchat-native-theming

CometChatThemeProvider + CometChatI18nProvider — color tokens, typography, dark mode, per-component style overrides, and localization (18 built-in languages + custom translations). The JS theme object replaces CSS variables.

cometchat · AI review on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add cometchat/cometchat-skills --skill cometchat-native-theming

About this skill


name: cometchat-native-theming description: "CometChatThemeProvider + CometChatI18nProvider — color tokens, typography, dark mode, per-component style overrides, and localization (18 built-in languages + custom translations). The JS theme object replaces CSS variables." license: "MIT" compatibility: "Node.js >=18; React Native >=0.70; @cometchat/chat-uikit-react-native ^5" allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion" metadata: author: "CometChat" version: "3.0.0" tags: "cometchat react-native theming colors dark-mode typography"

Purpose

Teaches Claude how to theme and localize the React Native UI Kit via CometChatThemeProvider + CometChatI18nProvider. No CSS — React Native uses a JS theme object instead. This skill covers color tokens, typography, light/dark modes, per-component style overrides, the useTheme() hook for custom views, and localization (18 built-in languages, device auto-detect, custom translation overrides) via useCometChatTranslation().

Read cometchat-native-core first (the wrapper chain that includes CometChatThemeProvider) before this skill. cometchat-native-components § 13 covers per-component style={} overrides, which are a sibling concern to theming.

Ground truth: docs/ui-kit/react-native/theme.mdx, colors.mdx, component-styling.mdx, message-bubble-styling.mdx, and packages/ChatUiKit/src/theme/type.ts (the canonical type definitions).


1. How theming works (no CSS — JS theme object)

React Native has no CSS. Instead:

CometChatThemeProvider
  ↓  (provides theme via React Context)
every <CometChat*> component reads theme via internal useTheme()
  ↓
component's default styles merge with theme overrides → rendered styles

The theme object you pass has two top-level keys for light/dark variants:

<CometChatThemeProvider
  theme={{
    mode: "light",      // or "dark", or omit for OS-default
    light: { color: { primary: "#F76808" } },
    dark:  { color: { primary: "#FF8A3D" } },
  }}
>
  <App />
</CometChatThemeProvider>

Style precedence (highest to lowest)

  1. Component style={} prop — wins always. Per-component tweak, overrides everything.
  2. Custom theme via CometChatThemeProvider — app-wide.
  3. Default theme — the UI Kit's built-in palette.

So for a one-off color on a single component, use style={}. For a brand-wide change (primary color everywhere), use the theme.

Deep merge

Theme values are deeply merged with defaults — you only specify what you want to change:

theme={{
  light: {
    color: {
      primary: "#F76808",      // override just primary; everything else keeps defaults
    },
    typography: {
      heading1: { fontWeight: "700" },  // override just heading1 weight
    },
  },
}}

2. The CometChatThemeProvider

Minimum setup — follow system light/dark

import { CometChatThemeProvider } from "@cometchat/chat-uikit-react-native";

<CometChatThemeProvider>
  {/* children read the current system mode automatically */}
</CometChatThemeProvider>

Force a mode

<CometChatThemeProvider theme={{ mode: "light" }}>{/* ... */}</CometChatThemeProvider>
<CometChatThemeProvider theme={{ mode: "dark"  }}>{/* ... */}</CometChatThemeProvider>

Placement in the wrapper chain

CometChatThemeProvider is one of the four required wrappers — goes right above CometChatProvider, below SafeAreaProvider (see cometchat-native-core § 3):

<GestureHandlerRootView style={{ flex: 1 }}>
  <SafeAreaProvider>
    <CometChatThemeProvider theme={/* your theme */}>
      <CometChatProvider appId={...} region={...} authKey={...}>
        <YourApp />
      </CometChatProvider>
    </CometChatThemeProvider>
  </SafeAreaProvider>
</GestureHandlerRootView>

Without CometChatThemeProvider, components throw or fall back to minimal styles. Even if you don't customize anything, the wrapper is mandatory.


3. Color tokens

Every color is a hex string ("#F76808" — never "rgb(...)" or named colors).

Primary (brand accent)

TokenControls
primaryOutgoing message bubbles, send button, active tabs, buttons
extendedPrimary50–900Auto-derived shades of primary. Used for hover, pressed, subtle accents. Only override these if you need finer control — the auto-derivation is usually correct.

Neutrals (surfaces + borders)

TokenDefault (light)Controls
neutral50#FFFFFFWhite/light surface, background1 default
neutral100#FAFAFAbackground2 default
neutral200#F5F5F5background3 default
neutral300#E8E8E8Incoming bubble default, borders
neutral400#DCDCDCDivider lines
neutral500#A1A1A1Placeholder / muted text, iconSecondary default
neutral600#727272textSecondary (timestamps, subtitles)
neutral700#5B5B5BBody text tier 3
neutral800#434343Headings default
neutral900#141414textPrimary default, iconPrimary default

Background aliases

TokenMaps to (default)Controls
background1neutral50Main app background
background2neutral100Sidebars, panels
background3neutral200Nested panels, cards
background4neutral300Additional surface

Text

TokenDefaultControls
textPrimaryneutral900Main body text
textSecondaryneutral600Timestamps, subtitles
textTertiaryneutral500Hints, placeholders
textHighlightprimaryLinks, mentions

Icon

TokenDefaultControls
iconPrimaryneutral900Active / default icons
iconSecondaryneutral500Inactive icons
iconHighlightprimaryAction icons

Semantic (state indicators)

TokenDefault (light)Controls
info#0B7BEAInfo
Read the complete source ↗