/cometchat-skills:cometchat-react-native-customizationfrom cometchat-skills
Themes, restyles, and extends the CometChat React Native UI Kit v5 using theme modes, color tokens, per-component style objects, view slots, and the DataSource decorator chain for custom message types.
Ships in cometchat-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Ground truth:
@cometchat/chat-uikit-react-native@5+ catalogrn-v5.json. Docs:/ui-kit/react-native/theme·colors·component-styling·message-bubble-styling. Fetch token names and style keys from docs — never invent them.
cometchat-react-native-core — install, provider chain, init→login→render. Assumed, not repeated here.Cloning a named app, or mixing kit components with your own UI? Measure the target's colors, type, spacing and radii into ONE token source, theme the kit from it, and style every custom component from the same tokens so kit and custom parts look like one design; host a kit component in your own dialog/panel when only its placement differs. Flow: cometchat-onboarding → references/clone-mode.md (Design sync, build levels L0–L6).
Avatar + sender name on every message (own and others', 1:1 and group): the kit default shows them only on others' messages in groups. Fix it yourself whenever the target shows them: references/message-chrome.md (alignment="leftAligned", then per-message LeadingView / HeaderView via a decorator).
None beyond core. Theming needs CometChatThemeProvider already in the chain (see core).
There is no CSS. No stylesheets, no className, no --cometchat-* variables. If you are
holding a React snippet with CSS custom properties, it does not apply here.
The provider takes a theme prop shaped { mode, light, dark }. mode is "light" · "dark" ·
"auto" — "auto" is what makes the kit follow the device (OS) light/dark setting (it reads
useColorScheme()); the provider default is already "auto".
// Fixed dark for the whole app.
<CometChatThemeProvider theme={{ mode: "dark" }}>{/* ... */}</CometChatThemeProvider>
// Follow the OS, branded in BOTH schemes. mode:"auto" is the switch;
// set BOTH light and dark or dark falls back to defaults.
<CometChatThemeProvider
theme={{
mode: "auto",
light: { color: { primary: "#F76808" } },
dark: { color: { primary: "#F8935B" } },
}}
>
{/* ... */}
</CometChatThemeProvider>
primary drives buttons, outgoing bubbles and active states — it is usually the only token a brand
change needs. Other common tokens: textPrimary, background1, neutral50, extendedPrimary500.
Fetch the full list from /ui-kit/react-native/colors.md rather than guessing a token name.
To follow the OS, use mode: "auto" and set both light and dark. Without the provider,
system theme changes are not reflected at all.
Every component takes a style prop holding named sub-style objects — plain RN style objects,
not CSS:
<CometChatConversations style={{ containerStyle: { backgroundColor: "#F7F7F7" } }} />
The same style keys can be set globally through the theme instead, which is preferable when the change should apply everywhere:
<CometChatThemeProvider theme={{ light: { conversationStyles: { /* ... */ } } }}>
Style-key names differ per component. Fetch them from that component's page
(/ui-kit/react-native/component-styling.md and the component's own page) — do not pattern-match
from another component.
useTheme() returns the resolved theme (already light-or-dark per mode), so custom views match
the kit without re-deriving the palette:
import { useTheme } from "@cometchat/chat-uikit-react-native";
import { Text } from "react-native";
const Label = () => {
const theme = useTheme();
return <Text style={{ color: theme.color.textPrimary }}>Chats</Text>;
};
⚠️ RN does NOT have the React plugin API. CometChatMessagePlugin and CometChatPluginRegistry
do not exist in this kit; emitting them will not compile. RN uses a decorator chain.
Extend DataSourceDecorator, override what you need, and register it with ChatConfigurator.enable:
import {
ChatConfigurator, DataSourceDecorator, CometChatMessageTemplate,
} from "@cometchat/chat-uikit-react-native";
const ORDER_TYPE = "order";
class OrderDataSource extends DataSourceDecorator {
// 0. IDENTITY — REQUIRED. The base DataSourceDecorator.getId() THROWS
// ("Method not implemented.") and ChatConfigurator.enable() calls getId() to
// dedupe the registry — so a subclass without this override crashes at
// ChatConfigurator.enable(...), NOT at render. Return a stable, unique id.
getId(): string {
return "order_message_datasource";
}
// 1. RENDER — how the bubble draws.
getAllMessageTemplates(theme?: any, params?: any): CometChatMessageTemplate[] {
const templates = super.getAllMessageTemplates(theme, params);
// append or replace a template here
return templates;
}
// 2. FETCH — WITHOUT THESE TWO THE MESSAGE IS NEVER RETRIEVED.
// CometChatMessageList builds its request from them:
// requestBuilder.setTypes(ChatConfigurator.dataSource.getAllMessageTypes())
// requestBuilder.setCategories(ChatConfigurator.dataSource.getAllMessageCategories())
// A type absent from those filters is excluded server-side. The bubble appears
// optimistically when sent, then vanishes on reload — with no error anywhere.
getAllMessageTypes(): string[] {
return [...super.getAllMessageTypes(), ORDER_TYPE];
}
getAllMessageCategories(): string[] {
const categories = super.getAllMessageCategories();
return categories.includes(CometChat.CATEGORY_CUSTOM)
? categories
: [...categories, CometChat.CATEGORY_CUSTOM];
}
}
// AFTER login(), not merely after init(). CometChatUIKit.login() calls enableExtensions(),
// whose first statement is ChatConfigurator.init() — "re-initialize data source". Anything
// registered earlier is DISCARDED, so a decorator wired at module scope, or straight after
// init(), silently disappears.
await CometChatUIKit.login({ uid: UID });
ChatConfigurator.enable((source) => new OrderDataSource(source));
getId() is REQUIRED on every DataSourceDecorator subclass. It is the ONE base method that
does not delegate to the wrapped source — the base throws Error("Method not implemented."), and
ChatConfigurator.enable() calls getId() to dedupe the registry. Omit it and registration crashes
at ChatConfigurator.enable(...) with Method not implemented. — NOT at render, so it reads as
unrelated. Every built-in decorator (Polls, Stickers, Translation, LinkPreview, Collaborative*)
overrides it; yours must too, returning a stable unique string.
A custom message type is two halves, and only one of them is obvious. Render is
getAllMessageTemplates / getMessageTemplate. Fetch is getAllMessageTypes /
getAllMessageCategories. Ship the render half alone and everything looks right until the first
reload, when every message of your type is gone — no error, no warning.
DataSourceDecorator exposes ~50 overridable methods; the ones you usually want are getId
(mandatory — see above), getAllMessageTemplates, getMessageTemplate, getAllMessageTypes,
getAllMessageCategories, getMessageOptions (the long-press menu) and
getAuxiliaryOptions (composer actions). Always call super.<method>(...) and modify the result —
replacing it wholesale drops every built-in message type.
DOCS GAP (RN-G10):
DataSourceDecorator/MessageDataSource/ExtensionsDataSourceandChatConfigurator.enableare not documented on any RN page — the docs show only mutating existing templates viagetAllMessageTemplates(). Built from the kit source; flag this to the developer rather than presenting it as documented.Partially closed (2026-08-20).
ui-kit/react-native/message-listnow documents the half that actually breaks builds: a custom type must be registered for fetch (getAllMessageTypes/getAllMessageCategories), not only for render, and the decorator must be registered afterlogin()becauseenableExtensions()re-runsChatConfigurator.init(). Still missing: a dedicated RN custom-message-types page coveringDataSourceDecorator/MessageDataSource/ExtensionsDataSourceend to end. Owner: docs.
To restyle rather than replace, prefer the theme's bubble style keys —
textBubbleStyles, imageBubbleStyles, fileBubbleStyles, pollBubbleStyles and siblings.
Fetch exact keys from /ui-kit/react-native/message-bubble-styling.md.
className, no --cometchat-*. Theme object + RN styles.ChatConfigurator + DataSourceDecorator.getId() on a decorator — the base throws; ChatConfigurator.enable() calls it → crash at registration with Method not implemented.super in a decorator override — silently drops all built-in templates.light when the app follows the OS — dark mode then falls back to defaults.catalogs/rn-v5.json.npm run verify:fences:rn-v5 compiles the examples against the pinned kit.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cometchat, react-native, chat-ui, theming, customization, message-bubble
npx claudepluginhub cometchat/cometchat-skills --plugin cometchat-skills98 skills in this plugin
/cometchatEntry point for any CometChat task on any platform. Detects the framework + UI Kit version (React, Angular, iOS, Android, React Native, Flutter), then routes to that family's skills — for a NEW integration or a change to an existing one. Triggers: 'add chat', 'add cometchat', 'add chat to my app', 'add calling', 'change something in my chat', 'my chat is already set up', 'add a feature to the chat', 'add chat to my android app', 'integrate cometchat android', 'add chat to my ios app', 'integrate cometchat ios', 'add chat to my swift app', 'migrate my app to cometchat', 'migrate from sendbird', 'migrate from getstream / stream', 'replace sendbird / stream chat with cometchat', 'build a <app> clone', 'make a chat app like <app>', 'make it look and work like <app>'./cometchat-a11yKeep a CometChat integration accessible — the UI Kit is designed targeting WCAG 2.1 AA with keyboard navigation (verify per component in its docs; full conformance still needs manual testing), and this skill makes sure the HOST app doesn't break that, covering contrast, focus, screen-reader context, reduced motion, RTL, and calls accessibility. Cross-family. Triggers: 'is cometchat accessible', 'WCAG / 508 / ADA compliance', 'screen reader support', 'keyboard navigation', 'a11y audit', 'accessible chat', 'contrast/focus issues in chat'./cometchat-analyticsSee what your chat is doing — pull usage & message metrics via REST, stream real-time events to your data/observability stack via webhooks, monitor client-side errors & the init/login path, and read push/call logs. Cross-family: metrics/webhooks are server-side; client error monitoring wires per family. Triggers: 'chat analytics', 'usage metrics', 'message volume', 'monitor cometchat', 'observability', 'send chat events to datadog/segment/bigquery', 'track delivery', 'error monitoring for chat', 'dashboards for chat'./cometchat-android-v5-calls-sdkAdd voice & video calling to any Android app FROM SCRATCH with the headless CometChat Calls SDK v5 (`com.cometchat:calls-sdk-android:5.0.4`) — no UI Kit. Kotlin: initFromSettings→login→generateToken→joinSession into a RelativeLayout, lifecycle-bound listeners, meet-style session rooms AND 1:1 ringing (Chat SDK v5 signaling + Calls SDK media), call logs, layouts, audio modes, recording, PiP, background service. Triggers: 'add calling from scratch android', 'standalone video call kotlin', 'headless calls sdk android', 'build my own call UI android', 'meeting room join by session id android', 'one-on-one ringing call without uikit android'./cometchat-android-v5-sdkBuild chat on Android with the headless CometChat Chat SDK v5 and your OWN UI — init/login ordering, the method map, request-builder pagination, listener lifecycle, and a production-ready app surface (optimistic updates, error states, sized shell). Use when the app needs custom UI instead of the drop-in UI Kit. Triggers: 'cometchat android sdk', 'chat with my own ui android', 'headless cometchat android', 'send message with chat-sdk-android', 'cometchat message listener kotlin'./cometchat-android-v6-builder-settingsThe CometChat Android v6 settings and session API reference — the assets/cometchat-settings.json file that initFromSettings reads (appId, region, credentials, uiKit toggles), the legacy UIKitSettings builder, and the CometChatUIKit session methods (login, loginWithAuthToken, logout, getLoggedInUser, createUser). Use when configuring init options or wiring auth beyond the core golden path. Triggers: 'cometchat settings json android', 'uikitsettings builder options', 'login with auth token android', 'create a cometchat user from the app', 'enable calling in settings'.Other plugins' skills for the same job