@cometchat/skills 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -17
  3. package/bin/install.js +389 -43
  4. package/package.json +19 -9
  5. package/skills/cometchat/SKILL.md +1066 -265
  6. package/skills/cometchat-android-v5/SKILL.md +120 -0
  7. package/skills/cometchat-android-v5-components/SKILL.md +430 -0
  8. package/skills/cometchat-android-v5-core/SKILL.md +468 -0
  9. package/skills/cometchat-android-v5-customization/SKILL.md +305 -0
  10. package/skills/cometchat-android-v5-extensions/SKILL.md +124 -0
  11. package/skills/cometchat-android-v5-features/SKILL.md +130 -0
  12. package/skills/cometchat-android-v5-placement/SKILL.md +276 -0
  13. package/skills/cometchat-android-v5-production/SKILL.md +94 -0
  14. package/skills/cometchat-android-v5-push/SKILL.md +620 -0
  15. package/skills/cometchat-android-v5-testing/SKILL.md +187 -0
  16. package/skills/cometchat-android-v5-theming/SKILL.md +166 -0
  17. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +73 -0
  18. package/skills/cometchat-android-v6/SKILL.md +107 -0
  19. package/skills/cometchat-android-v6-builder-settings/SKILL.md +145 -0
  20. package/skills/cometchat-android-v6-compose-components/SKILL.md +202 -0
  21. package/skills/cometchat-android-v6-compose-customization/SKILL.md +280 -0
  22. package/skills/cometchat-android-v6-compose-placement/SKILL.md +213 -0
  23. package/skills/cometchat-android-v6-compose-theming/SKILL.md +224 -0
  24. package/skills/cometchat-android-v6-core/SKILL.md +354 -0
  25. package/skills/cometchat-android-v6-events/SKILL.md +212 -0
  26. package/skills/cometchat-android-v6-extensions/SKILL.md +191 -0
  27. package/skills/cometchat-android-v6-features/SKILL.md +130 -0
  28. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +197 -0
  29. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +268 -0
  30. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +248 -0
  31. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +202 -0
  32. package/skills/cometchat-android-v6-production/SKILL.md +187 -0
  33. package/skills/cometchat-android-v6-push/SKILL.md +274 -0
  34. package/skills/cometchat-android-v6-testing/SKILL.md +279 -0
  35. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +249 -0
  36. package/skills/cometchat-angular-components/SKILL.md +706 -0
  37. package/skills/cometchat-angular-core/SKILL.md +444 -0
  38. package/skills/cometchat-angular-customization/SKILL.md +424 -0
  39. package/skills/cometchat-angular-features/SKILL.md +447 -0
  40. package/skills/cometchat-angular-patterns/SKILL.md +447 -0
  41. package/skills/cometchat-angular-placement/SKILL.md +685 -0
  42. package/skills/cometchat-angular-production/SKILL.md +415 -0
  43. package/skills/cometchat-angular-theming/SKILL.md +365 -0
  44. package/skills/cometchat-angular-troubleshooting/SKILL.md +329 -0
  45. package/skills/cometchat-astro-patterns/SKILL.md +3 -3
  46. package/skills/cometchat-components/SKILL.md +11 -0
  47. package/skills/cometchat-core/SKILL.md +11 -6
  48. package/skills/cometchat-customization/references/component-catalog.md +1 -1
  49. package/skills/cometchat-features/SKILL.md +176 -108
  50. package/skills/cometchat-flutter-v5/SKILL.md +167 -0
  51. package/skills/cometchat-flutter-v5-calls/SKILL.md +192 -0
  52. package/skills/cometchat-flutter-v5-conversations/SKILL.md +117 -0
  53. package/skills/cometchat-flutter-v5-core/SKILL.md +221 -0
  54. package/skills/cometchat-flutter-v5-customization/SKILL.md +227 -0
  55. package/skills/cometchat-flutter-v5-events/SKILL.md +155 -0
  56. package/skills/cometchat-flutter-v5-messages/SKILL.md +258 -0
  57. package/skills/cometchat-flutter-v5-production/SKILL.md +207 -0
  58. package/skills/cometchat-flutter-v5-push/SKILL.md +284 -0
  59. package/skills/cometchat-flutter-v5-theming/SKILL.md +160 -0
  60. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +129 -0
  61. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +151 -0
  62. package/skills/cometchat-flutter-v6/SKILL.md +445 -0
  63. package/skills/cometchat-flutter-v6-calls/SKILL.md +333 -0
  64. package/skills/cometchat-flutter-v6-components/SKILL.md +365 -0
  65. package/skills/cometchat-flutter-v6-conversations/SKILL.md +210 -0
  66. package/skills/cometchat-flutter-v6-core/SKILL.md +305 -0
  67. package/skills/cometchat-flutter-v6-customization/SKILL.md +666 -0
  68. package/skills/cometchat-flutter-v6-events/SKILL.md +216 -0
  69. package/skills/cometchat-flutter-v6-features/SKILL.md +406 -0
  70. package/skills/cometchat-flutter-v6-messages/SKILL.md +333 -0
  71. package/skills/cometchat-flutter-v6-migration/SKILL.md +381 -0
  72. package/skills/cometchat-flutter-v6-placement/SKILL.md +398 -0
  73. package/skills/cometchat-flutter-v6-production/SKILL.md +632 -0
  74. package/skills/cometchat-flutter-v6-theming/SKILL.md +260 -0
  75. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +726 -0
  76. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +216 -0
  77. package/skills/cometchat-ios/SKILL.md +323 -0
  78. package/skills/cometchat-ios-components/SKILL.md +651 -0
  79. package/skills/cometchat-ios-core/SKILL.md +822 -0
  80. package/skills/cometchat-ios-customization/SKILL.md +825 -0
  81. package/skills/cometchat-ios-features/SKILL.md +725 -0
  82. package/skills/cometchat-ios-placement/SKILL.md +750 -0
  83. package/skills/cometchat-ios-production/SKILL.md +730 -0
  84. package/skills/cometchat-ios-push/SKILL.md +582 -0
  85. package/skills/cometchat-ios-theming/SKILL.md +631 -0
  86. package/skills/cometchat-ios-troubleshooting/SKILL.md +983 -0
  87. package/skills/cometchat-native-bare-patterns/SKILL.md +470 -0
  88. package/skills/cometchat-native-components/SKILL.md +594 -0
  89. package/skills/cometchat-native-core/SKILL.md +407 -0
  90. package/skills/cometchat-native-customization/SKILL.md +594 -0
  91. package/skills/cometchat-native-expo-patterns/SKILL.md +485 -0
  92. package/skills/cometchat-native-features/SKILL.md +608 -0
  93. package/skills/cometchat-native-placement/SKILL.md +500 -0
  94. package/skills/cometchat-native-production/SKILL.md +694 -0
  95. package/skills/cometchat-native-push/SKILL.md +593 -0
  96. package/skills/cometchat-native-testing/SKILL.md +583 -0
  97. package/skills/cometchat-native-theming/SKILL.md +656 -0
  98. package/skills/cometchat-native-troubleshooting/SKILL.md +433 -0
  99. package/skills/cometchat-nextjs-patterns/SKILL.md +5 -5
  100. package/skills/cometchat-production/SKILL.md +60 -0
  101. package/skills/cometchat-react-router-patterns/SKILL.md +23 -21
@@ -0,0 +1,656 @@
1
+ ---
2
+ name: cometchat-native-theming
3
+ 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."
4
+ license: "MIT"
5
+ compatibility: "Node.js >=18; React Native >=0.70; @cometchat/chat-uikit-react-native ^5"
6
+ allowed-tools: "executeBash, readFile, fileSearch, listDirectory, AskUserQuestion"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "3.0.0"
10
+ tags: "cometchat react-native theming colors dark-mode typography"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ 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()`.
16
+
17
+ **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.
18
+
19
+ 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).
20
+
21
+ ---
22
+
23
+ ## 1. How theming works (no CSS — JS theme object)
24
+
25
+ React Native has no CSS. Instead:
26
+
27
+ ```
28
+ CometChatThemeProvider
29
+ ↓ (provides theme via React Context)
30
+ every <CometChat*> component reads theme via internal useTheme()
31
+
32
+ component's default styles merge with theme overrides → rendered styles
33
+ ```
34
+
35
+ The theme object you pass has two top-level keys for light/dark variants:
36
+
37
+ ```tsx
38
+ <CometChatThemeProvider
39
+ theme={{
40
+ mode: "light", // or "dark", or omit for OS-default
41
+ light: { color: { primary: "#F76808" } },
42
+ dark: { color: { primary: "#FF8A3D" } },
43
+ }}
44
+ >
45
+ <App />
46
+ </CometChatThemeProvider>
47
+ ```
48
+
49
+ ### Style precedence (highest to lowest)
50
+
51
+ 1. **Component `style={}` prop** — wins always. Per-component tweak, overrides everything.
52
+ 2. **Custom theme** via `CometChatThemeProvider` — app-wide.
53
+ 3. **Default theme** — the UI Kit's built-in palette.
54
+
55
+ So for a one-off color on a single component, use `style={}`. For a brand-wide change (primary color everywhere), use the theme.
56
+
57
+ ### Deep merge
58
+
59
+ Theme values are deeply merged with defaults — you only specify what you want to change:
60
+
61
+ ```tsx
62
+ theme={{
63
+ light: {
64
+ color: {
65
+ primary: "#F76808", // override just primary; everything else keeps defaults
66
+ },
67
+ typography: {
68
+ heading1: { fontWeight: "700" }, // override just heading1 weight
69
+ },
70
+ },
71
+ }}
72
+ ```
73
+
74
+ ---
75
+
76
+ ## 2. The CometChatThemeProvider
77
+
78
+ ### Minimum setup — follow system light/dark
79
+
80
+ ```tsx
81
+ import { CometChatThemeProvider } from "@cometchat/chat-uikit-react-native";
82
+
83
+ <CometChatThemeProvider>
84
+ {/* children read the current system mode automatically */}
85
+ </CometChatThemeProvider>
86
+ ```
87
+
88
+ ### Force a mode
89
+
90
+ ```tsx
91
+ <CometChatThemeProvider theme={{ mode: "light" }}>{/* ... */}</CometChatThemeProvider>
92
+ <CometChatThemeProvider theme={{ mode: "dark" }}>{/* ... */}</CometChatThemeProvider>
93
+ ```
94
+
95
+ ### App-controlled theme toggle (wire to the project's existing theme system)
96
+
97
+ If the project already has a dark-mode toggle, wire `CometChatThemeProvider`'s `mode` prop to the same source. RN doesn't have CSS selectors — the React Native theme is just a value held somewhere in JS, and you forward that value to CometChat. Three common shapes:
98
+
99
+ ```tsx
100
+ // Pattern A — OS-driven (no toggle yet, just react to system)
101
+ import { useColorScheme } from "react-native";
102
+
103
+ function ThemedRoot({ children }: { children: React.ReactNode }) {
104
+ const scheme = useColorScheme(); // "light" | "dark" | null
105
+ return (
106
+ <CometChatThemeProvider theme={{ mode: scheme === "dark" ? "dark" : "light" }}>
107
+ {children}
108
+ </CometChatThemeProvider>
109
+ );
110
+ }
111
+ ```
112
+
113
+ ```tsx
114
+ // Pattern B — App-controlled toggle via custom Context
115
+ const ThemeContext = createContext<{ mode: "light" | "dark"; toggle: () => void }>({
116
+ mode: "light",
117
+ toggle: () => {},
118
+ });
119
+
120
+ function ThemedRoot({ children }: { children: React.ReactNode }) {
121
+ const { mode } = useContext(ThemeContext);
122
+ return (
123
+ <CometChatThemeProvider theme={{ mode }}>{children}</CometChatThemeProvider>
124
+ );
125
+ }
126
+ ```
127
+
128
+ ```tsx
129
+ // Pattern C — react-native-paper (or any provider that exposes a theme)
130
+ import { useTheme } from "react-native-paper";
131
+
132
+ function ThemedRoot({ children }: { children: React.ReactNode }) {
133
+ const paperTheme = useTheme();
134
+ return (
135
+ <CometChatThemeProvider theme={{ mode: paperTheme.dark ? "dark" : "light" }}>
136
+ {children}
137
+ </CometChatThemeProvider>
138
+ );
139
+ }
140
+ ```
141
+
142
+ **How to tell which pattern the project uses:**
143
+
144
+ | Library / setup | Where the mode lives | Wire `theme={{ mode: ... }}` to |
145
+ |---|---|---|
146
+ | Plain RN, no toggle yet | `useColorScheme()` from `react-native` | `scheme === "dark" ? "dark" : "light"` |
147
+ | Custom React Context | `useContext(ThemeContext).mode` (or whatever shape it has) | Read from the context |
148
+ | `react-native-paper` | `useTheme().dark` | `dark ? "dark" : "light"` |
149
+ | `restyle` | `useTheme<Theme>().colors` (no built-in mode flag — track separately) | A sibling Context that holds the mode string |
150
+ | `tamagui` | `useThemeName()` returns the current theme name | `name === "dark" ? "dark" : "light"` |
151
+ | `Appearance.addChangeListener` (manual OS) | A `useState` that mirrors `Appearance.getColorScheme()` | Read from that state |
152
+
153
+ **Rule:** wherever the project's theme toggle writes its current state, read from THAT and forward to `CometChatThemeProvider`'s `mode` prop. Don't keep two parallel sources of truth.
154
+
155
+ **Don't** combine Pattern A with Pattern B unless the user explicitly wants "follow OS until the user opens settings and overrides." That hybrid is legitimate but usually over-engineered for a first integration — ship Pattern B alone if the project has a toggle, Pattern A if it doesn't.
156
+
157
+ ### Placement in the wrapper chain
158
+
159
+ `CometChatThemeProvider` is one of the four required wrappers — goes right above `CometChatProvider`, below `SafeAreaProvider` (see `cometchat-native-core` § 3):
160
+
161
+ ```tsx
162
+ <GestureHandlerRootView style={{ flex: 1 }}>
163
+ <SafeAreaProvider>
164
+ <CometChatThemeProvider theme={/* your theme */}>
165
+ <CometChatProvider appId={...} region={...} authKey={...}>
166
+ <YourApp />
167
+ </CometChatProvider>
168
+ </CometChatThemeProvider>
169
+ </SafeAreaProvider>
170
+ </GestureHandlerRootView>
171
+ ```
172
+
173
+ Without `CometChatThemeProvider`, components throw or fall back to minimal styles. Even if you don't customize anything, the wrapper is mandatory.
174
+
175
+ ---
176
+
177
+ ## 3. Color tokens
178
+
179
+ Every color is a hex string (`"#F76808"` — never `"rgb(...)"` or named colors).
180
+
181
+ ### Primary (brand accent)
182
+
183
+ | Token | Controls |
184
+ |---|---|
185
+ | `primary` | Outgoing message bubbles, send button, active tabs, buttons |
186
+ | `extendedPrimary50–900` | Auto-derived shades of primary. Used for hover, pressed, subtle accents. **Only override these if you need finer control** — the auto-derivation is usually correct. |
187
+
188
+ ### Neutrals (surfaces + borders)
189
+
190
+ | Token | Default (light) | Controls |
191
+ |---|---|---|
192
+ | `neutral50` | `#FFFFFF` | White/light surface, background1 default |
193
+ | `neutral100` | `#FAFAFA` | background2 default |
194
+ | `neutral200` | `#F5F5F5` | background3 default |
195
+ | `neutral300` | `#E8E8E8` | Incoming bubble default, borders |
196
+ | `neutral400` | `#DCDCDC` | Divider lines |
197
+ | `neutral500` | `#A1A1A1` | Placeholder / muted text, iconSecondary default |
198
+ | `neutral600` | `#727272` | textSecondary (timestamps, subtitles) |
199
+ | `neutral700` | `#5B5B5B` | Body text tier 3 |
200
+ | `neutral800` | `#434343` | Headings default |
201
+ | `neutral900` | `#141414` | textPrimary default, iconPrimary default |
202
+
203
+ ### Background aliases
204
+
205
+ | Token | Maps to (default) | Controls |
206
+ |---|---|---|
207
+ | `background1` | `neutral50` | Main app background |
208
+ | `background2` | `neutral100` | Sidebars, panels |
209
+ | `background3` | `neutral200` | Nested panels, cards |
210
+ | `background4` | `neutral300` | Additional surface |
211
+
212
+ ### Text
213
+
214
+ | Token | Default | Controls |
215
+ |---|---|---|
216
+ | `textPrimary` | `neutral900` | Main body text |
217
+ | `textSecondary` | `neutral600` | Timestamps, subtitles |
218
+ | `textTertiary` | `neutral500` | Hints, placeholders |
219
+ | `textHighlight` | `primary` | Links, mentions |
220
+
221
+ ### Icon
222
+
223
+ | Token | Default | Controls |
224
+ |---|---|---|
225
+ | `iconPrimary` | `neutral900` | Active / default icons |
226
+ | `iconSecondary` | `neutral500` | Inactive icons |
227
+ | `iconHighlight` | `primary` | Action icons |
228
+
229
+ ### Semantic (state indicators)
230
+
231
+ | Token | Default (light) | Controls |
232
+ |---|---|---|
233
+ | `info` | `#0B7BEA` | Info callouts, links |
234
+ | `warning` | `#FFAB00` | Warning callouts |
235
+ | `success` | `#09C26F` | Online indicator, success messages |
236
+ | `error` | `#F44649` | Error messages, validation |
237
+
238
+ ### Bubble-specific
239
+
240
+ | Token | Default | Controls |
241
+ |---|---|---|
242
+ | `sendBubbleBackground` | `primary` | Outgoing bubble bg |
243
+ | `sendBubbleText` | `staticWhite` (`#FFFFFF`) | Outgoing bubble text |
244
+ | `receiveBubbleBackground` | `neutral300` | Incoming bubble bg |
245
+ | `receiveBubbleText` | `neutral900` | Incoming bubble text |
246
+
247
+ ### Static (never flip light/dark)
248
+
249
+ | Token | Value | Controls |
250
+ |---|---|---|
251
+ | `staticBlack` | `#141414` | Fixed dark elements (overlays, opacity-based) |
252
+ | `staticWhite` | `#FFFFFF` | Fixed light elements |
253
+
254
+ ---
255
+
256
+ ## 4. Mode: light / dark / system
257
+
258
+ ### Follow system
259
+
260
+ Don't pass `mode` — the provider reads the OS setting via `useColorScheme()` and re-renders on change. The user gets automatic dark mode when they flip the system setting.
261
+
262
+ ```tsx
263
+ <CometChatThemeProvider>{/* ... */}</CometChatThemeProvider>
264
+ ```
265
+
266
+ ### Force a specific mode
267
+
268
+ ```tsx
269
+ <CometChatThemeProvider theme={{ mode: "dark" }}>{/* ... */}</CometChatThemeProvider>
270
+ ```
271
+
272
+ ### Toggle controlled by your app
273
+
274
+ If your app has its own dark-mode switch (stored in user prefs or Redux), drive `mode` from that state:
275
+
276
+ ```tsx
277
+ const [darkMode, setDarkMode] = useState(false);
278
+ // ...
279
+ <CometChatThemeProvider theme={{ mode: darkMode ? "dark" : "light" }}>
280
+ <Switch value={darkMode} onValueChange={setDarkMode} />
281
+ <App />
282
+ </CometChatThemeProvider>
283
+ ```
284
+
285
+ The provider re-renders children and they pick up the new theme immediately.
286
+
287
+ ### Dark-mode palette
288
+
289
+ Override the `dark` branch of the theme for a custom dark palette:
290
+
291
+ ```tsx
292
+ <CometChatThemeProvider
293
+ theme={{
294
+ light: { color: { primary: "#6852D6" } },
295
+ dark: { color: { primary: "#A594F3", background1: "#0B0B0F" } },
296
+ }}
297
+ >
298
+ ```
299
+
300
+ ---
301
+
302
+ ## 5. Typography overrides
303
+
304
+ The theme has a `typography` block with tokens per role:
305
+
306
+ ```tsx
307
+ <CometChatThemeProvider
308
+ theme={{
309
+ light: {
310
+ typography: {
311
+ heading1: { fontFamily: "Inter-Bold", fontSize: 28, fontWeight: "700" },
312
+ heading2: { fontFamily: "Inter-SemiBold", fontSize: 20 },
313
+ body1: { fontFamily: "Inter-Regular", fontSize: 15 },
314
+ caption1: { fontFamily: "Inter-Regular", fontSize: 12 },
315
+ // ... etc
316
+ },
317
+ },
318
+ }}
319
+ >
320
+ ```
321
+
322
+ Common tokens: `heading1`, `heading2`, `heading3`, `heading4`, `body1`, `body2`, `caption1`, `caption2`, `button1`, `button2`. Each follows the RN `TextStyle` shape — `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, `letterSpacing`.
323
+
324
+ ### Custom font setup
325
+
326
+ React Native font loading is NOT covered by the UI Kit — use your project's existing font system:
327
+
328
+ - **Expo**: `useFonts()` from `expo-font`, load before rendering the provider
329
+ - **Bare RN**: add fonts to `ios/<App>/Info.plist` `UIAppFonts` + `android/app/src/main/assets/fonts/` + run `npx react-native-asset`
330
+
331
+ Only reference a `fontFamily` in the theme once the font is actually loaded — otherwise iOS shows the system default and Android crashes.
332
+
333
+ ---
334
+
335
+ ## 6. Per-component style blocks
336
+
337
+ Beyond color / typography, the theme has per-component style blocks for fine control. These sit inside the `light` / `dark` branches:
338
+
339
+ ```tsx
340
+ <CometChatThemeProvider
341
+ theme={{
342
+ light: {
343
+ // component-specific overrides
344
+ conversationStyles: {
345
+ containerStyle: { backgroundColor: "#FAFAFA" },
346
+ },
347
+ messageHeaderStyles: {
348
+ titleStyle: { fontSize: 18 },
349
+ },
350
+ messageListStyles: {
351
+ containerStyle: { padding: 8 },
352
+ sendBubbleStyle: {
353
+ backgroundColor: "#F76808",
354
+ textStyle: { color: "#FFFFFF" },
355
+ },
356
+ receiveBubbleStyle: {
357
+ backgroundColor: "#F5F5F5",
358
+ textStyle: { color: "#141414" },
359
+ },
360
+ },
361
+ messageComposerStyles: {
362
+ containerStyle: { backgroundColor: "#FFF", borderTopWidth: 1, borderTopColor: "#E8E8E8" },
363
+ },
364
+ },
365
+ }}
366
+ >
367
+ ```
368
+
369
+ Common component-style keys: `conversationStyles`, `usersStyles`, `groupsStyles`, `groupMembersStyles`, `messageHeaderStyles`, `messageListStyles`, `messageComposerStyles`, `threadHeaderStyles`, `callButtonsStyles`, `callLogsStyles`.
370
+
371
+ Each block has the same nested shape as the component's `style` prop (see `cometchat-native-components` § 13).
372
+
373
+ ### Source of truth for available keys
374
+
375
+ The exact list of style keys per component is authoritative in the kit's type file:
376
+ ```
377
+ packages/ChatUiKit/src/theme/type.ts
378
+ ```
379
+
380
+ If you're overriding a component style and the TypeScript compiler complains about an unknown key, check that file (or use `useTheme()` + autocomplete in your IDE).
381
+
382
+ ---
383
+
384
+ ## 7. Common recipes
385
+
386
+ ### Match a brand color (most common)
387
+
388
+ ```tsx
389
+ <CometChatThemeProvider
390
+ theme={{ light: { color: { primary: "#FF6B35" } } }}
391
+ >
392
+ <App />
393
+ </CometChatThemeProvider>
394
+ ```
395
+
396
+ This single line changes the outgoing message bubble color, send button color, active tab indicator, and every primary accent in the UI. The `extendedPrimary50–900` tints are auto-derived from `primary`.
397
+
398
+ ### Dark mode + custom brand
399
+
400
+ ```tsx
401
+ <CometChatThemeProvider
402
+ theme={{
403
+ light: { color: { primary: "#FF6B35" } },
404
+ dark: { color: { primary: "#FF8F66", background1: "#1A1A1A" } },
405
+ }}
406
+ >
407
+ <App />
408
+ </CometChatThemeProvider>
409
+ ```
410
+
411
+ ### Custom message-bubble colors
412
+
413
+ ```tsx
414
+ <CometChatThemeProvider
415
+ theme={{
416
+ light: {
417
+ color: {
418
+ sendBubbleBackground: "#FF6B35",
419
+ sendBubbleText: "#FFFFFF",
420
+ receiveBubbleBackground: "#F0F0F0",
421
+ receiveBubbleText: "#1A1A1A",
422
+ },
423
+ },
424
+ }}
425
+ >
426
+ ```
427
+
428
+ Overriding the bubble tokens directly is cleaner than doing it via `messageListStyles.sendBubbleStyle` — the tokens apply consistently everywhere bubbles render (main list + thread panel + search results).
429
+
430
+ ### Custom font across the whole UI
431
+
432
+ 1. Load font (Expo `useFonts` or bare `npx react-native-asset`)
433
+ 2. Override the typography block:
434
+
435
+ ```tsx
436
+ <CometChatThemeProvider
437
+ theme={{
438
+ light: {
439
+ typography: {
440
+ heading1: { fontFamily: "Inter-Bold" },
441
+ heading2: { fontFamily: "Inter-SemiBold" },
442
+ heading3: { fontFamily: "Inter-SemiBold" },
443
+ heading4: { fontFamily: "Inter-Medium" },
444
+ body1: { fontFamily: "Inter-Regular" },
445
+ body2: { fontFamily: "Inter-Regular" },
446
+ caption1: { fontFamily: "Inter-Regular" },
447
+ caption2: { fontFamily: "Inter-Regular" },
448
+ button1: { fontFamily: "Inter-SemiBold" },
449
+ button2: { fontFamily: "Inter-Medium" },
450
+ },
451
+ },
452
+ }}
453
+ >
454
+ ```
455
+
456
+ ---
457
+
458
+ ## 8. Reading the theme in custom views
459
+
460
+ When you write a custom slot view (e.g. a `TitleView` on `CometChatMessageHeader`) and want your custom component to match the theme, use the `useTheme()` hook:
461
+
462
+ ```tsx
463
+ import { useTheme } from "@cometchat/chat-uikit-react-native";
464
+
465
+ function CustomTitle({ user }: any) {
466
+ const theme = useTheme();
467
+ return (
468
+ <Text style={{
469
+ color: theme.color.textPrimary,
470
+ fontFamily: theme.typography.heading3.fontFamily,
471
+ fontSize: theme.typography.heading3.fontSize,
472
+ }}>
473
+ {user.getName()}
474
+ </Text>
475
+ );
476
+ }
477
+
478
+ // Wire into a header:
479
+ <CometChatMessageHeader user={selectedUser} TitleView={(user) => <CustomTitle user={user} />} />
480
+ ```
481
+
482
+ This is how you write custom views that automatically follow dark mode — by reading tokens from `useTheme()` instead of hardcoding colors.
483
+
484
+ ---
485
+
486
+ ## 9. Localization — `CometChatI18nProvider`
487
+
488
+ Theming and localization are separate concerns but ship together. If your users aren't all English-speaking, wire `CometChatI18nProvider` alongside `CometChatThemeProvider`. Every string rendered by the UI Kit (message-action labels, empty states, system messages, alerts) flows through the i18n layer.
489
+
490
+ ### 9a. Built-in locales
491
+
492
+ The UI Kit ships translations for 18 languages out of the box:
493
+
494
+ ```
495
+ de, en, es, fr, hi, hu, it, ja, ko, lt, ms, nl, pt, ru, sv, tr, zh, zh-tw
496
+ ```
497
+
498
+ ### 9b. Wrapper chain with i18n — five wrappers, not four
499
+
500
+ `CometChatI18nProvider` goes above `CometChatThemeProvider` (theme is a child of i18n, not the other way around):
501
+
502
+ ```tsx
503
+ import { CometChatI18nProvider, CometChatThemeProvider } from "@cometchat/chat-uikit-react-native";
504
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
505
+ import { SafeAreaProvider } from "react-native-safe-area-context";
506
+
507
+ <GestureHandlerRootView style={{ flex: 1 }}>
508
+ <SafeAreaProvider>
509
+ <CometChatI18nProvider>
510
+ <CometChatThemeProvider>
511
+ <CometChatProvider>
512
+ <YourApp />
513
+ </CometChatProvider>
514
+ </CometChatThemeProvider>
515
+ </CometChatI18nProvider>
516
+ </SafeAreaProvider>
517
+ </GestureHandlerRootView>
518
+ ```
519
+
520
+ ### 9c. Auto-detect (default)
521
+
522
+ With no props, `CometChatI18nProvider` reads the device locale via `react-native-localize` and picks the matching language if available, falling back to English. No setup needed beyond the wrapper.
523
+
524
+ **Install `react-native-localize`** (required peer dep for auto-detect):
525
+ ```bash
526
+ npx expo install react-native-localize # Expo managed
527
+ # or
528
+ npm install react-native-localize && cd ios && pod install && cd .. # bare RN
529
+ ```
530
+
531
+ ### 9d. Force a specific language
532
+
533
+ Override the device default via `selectedLanguage`:
534
+
535
+ ```tsx
536
+ <CometChatI18nProvider selectedLanguage="ja">
537
+ ```
538
+
539
+ If the user's app has its own language preference (stored in settings / Redux / MMKV), drive `selectedLanguage` from that state. The provider re-renders children on change so strings update immediately.
540
+
541
+ ### 9e. Fallback behavior
542
+
543
+ Chain: **`selectedLanguage` (if set + available) → device language (if `autoDetectLanguage=true`) → `fallbackLanguage` (default `'en'`)**.
544
+
545
+ ```tsx
546
+ <CometChatI18nProvider
547
+ selectedLanguage={user.preferredLanguage} // from your app state
548
+ autoDetectLanguage={true} // fall back to device language
549
+ fallbackLanguage="en" // final fallback
550
+ >
551
+ ```
552
+
553
+ If the user's preferred language isn't bundled AND there's no custom translation for it, the provider logs a warning and uses the fallback.
554
+
555
+ ### 9f. Custom translations — override or add languages
556
+
557
+ Pass a `translations` object to override specific keys in an existing locale, or add a brand-new locale the UI Kit doesn't ship:
558
+
559
+ ```tsx
560
+ const translations = {
561
+ en: {
562
+ // Override a built-in English string
563
+ "NO_MESSAGES_YET": "Say hello to start the conversation!",
564
+ "SENT": "Delivered",
565
+ },
566
+ th: {
567
+ // Add a new language — Thai
568
+ "NO_MESSAGES_YET": "ยังไม่มีข้อความ",
569
+ "SENT": "ส่งแล้ว",
570
+ // ...provide the full key set
571
+ },
572
+ };
573
+
574
+ <CometChatI18nProvider selectedLanguage="th" translations={translations}>
575
+ ```
576
+
577
+ The translation schema is a flat `{ KEY: "string" }` map. Keys are screaming-snake-case (`NO_MESSAGES_YET`, `MESSAGE_COMPOSER_MENTION_ALL`, `TRANSLATE`, etc.). Full key list lives at `packages/ChatUiKit/src/shared/resources/CometChatLocalizeNew/resources/en/translation.json` in the UI Kit source — grep for `"KEY":` there to find the exact key for a string you want to override.
578
+
579
+ ### 9g. Reading the language inside custom views
580
+
581
+ When you write a custom slot view and need the current language (or want to translate your own strings using the same key set), use the `useCometChatTranslation` hook:
582
+
583
+ ```tsx
584
+ import { useCometChatTranslation } from "@cometchat/chat-uikit-react-native";
585
+
586
+ function CustomEmptyState() {
587
+ const { t, language } = useCometChatTranslation();
588
+ return <Text>{t("NO_MESSAGES_YET")}</Text>;
589
+ }
590
+ ```
591
+
592
+ The hook also exposes `availableLanguages` — useful for building a language-picker UI.
593
+
594
+ ### 9h. Common pitfall — i18n outside the provider
595
+
596
+ Calling `useCometChatTranslation()` from a component rendered OUTSIDE `CometChatI18nProvider` (common when a custom view mounts at the navigator root instead of inside the chat subtree) logs `"useCometChatTranslation used outside provider, using fallback translations"` and falls through to English. Check your wrapper chain — i18n must wrap every component that reads translations, which is the whole app tree in practice.
597
+
598
+ ---
599
+
600
+ ## 10. Anti-patterns
601
+
602
+ 1. **Don't pass non-hex colors.** `"rgb(...)"`, `"rgba(...)"`, named colors, or `hsl(...)` will break the kit's internal color math (used to derive `extendedPrimary`). Use `"#RRGGBB"` or `"#RRGGBBAA"` (opacity via alpha).
603
+
604
+ 2. **Don't override `staticBlack` / `staticWhite`.** They're "static" for a reason — used in places where a specific absolute color is needed regardless of theme (overlays, badges on fixed-color avatars). Overriding them breaks visual consistency.
605
+
606
+ 3. **Don't override extended primary colors unless you need to.** `extendedPrimary50–900` are auto-derived from `primary`. Override them only if the auto-derivation doesn't match your brand's tints — and then override the full range, not just one level.
607
+
608
+ 4. **Don't wrap `CometChatThemeProvider` inside a screen.** It belongs at the app root, once. Re-wrapping per screen creates hydration-like flashes on navigation and breaks dark-mode switching.
609
+
610
+ 5. **Don't mix theme overrides and per-component `style={}` for the same property.** `style={}` wins — the theme override becomes dead code. Pick one: theme for app-wide, `style={}` for one-offs.
611
+
612
+ 6. **Don't reference an unloaded font in typography.** iOS silently falls back to system default; Android crashes. Gate the provider on font loading:
613
+
614
+ ```tsx
615
+ // Expo example
616
+ const [fontsLoaded] = useFonts({ "Inter-Bold": require("./assets/Inter-Bold.ttf") });
617
+ if (!fontsLoaded) return null;
618
+ return (
619
+ <CometChatThemeProvider theme={{ light: { typography: { heading1: { fontFamily: "Inter-Bold" } } } }}>
620
+ <App />
621
+ </CometChatThemeProvider>
622
+ );
623
+ ```
624
+
625
+ 7. **Don't bypass the theme via `useColorScheme()` in a custom view.** Call `useTheme()` from `@cometchat/chat-uikit-react-native` — that gives you the current theme (including any overrides you set). `useColorScheme()` only gives you the raw system mode.
626
+
627
+ ---
628
+
629
+ ## 11. Verifying a theme change
630
+
631
+ After changing the theme:
632
+
633
+ 1. Hard-reload the Metro bundler (not Fast Refresh — theme context sometimes doesn't update on Fast Refresh)
634
+ 2. Send a message — check the outgoing bubble color matches `primary` / `sendBubbleBackground`
635
+ 3. Toggle dark mode on the device (iOS: Settings → Display; Android: Settings → Display → Dark theme)
636
+ 4. Check that both modes render without reloading the app
637
+
638
+ If something looks unstyled or crashes:
639
+ - Check the color is a hex string (not a name or rgb)
640
+ - Check the font (if you overrode typography) is actually loaded
641
+ - Check the override key matches the type in `packages/ChatUiKit/src/theme/type.ts`
642
+
643
+ ---
644
+
645
+ ## Skill routing reference
646
+
647
+ | Skill | When to route |
648
+ |---|---|
649
+ | `cometchat-native-core` | Always read first — init/login/provider wrapper chain |
650
+ | `cometchat-native-components` | For per-component `style={}` prop (sibling concern to theming) |
651
+ | `cometchat-native-placement` | Where CometChat components go |
652
+ | `cometchat-native-theming` | This skill — app-wide color/typography/dark mode |
653
+ | `cometchat-native-customization` | Custom slot views + `useTheme()` in your own components |
654
+ | `cometchat-native-expo-patterns` | Expo font loading via `expo-font` |
655
+ | `cometchat-native-bare-patterns` | Bare RN font loading via `react-native-asset` |
656
+ | `cometchat-native-troubleshooting` | Colors not applying, dark mode not switching, font shows system default |