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

cometchat-native-placement

Where to put chat in a React Native app — Stack screen, BottomTab, Modal, BottomSheet, Embedded. Maps each to CometChat component composition with ASCII layout references.

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-placement

About this skill


name: cometchat-native-placement description: "Where to put chat in a React Native app — Stack screen, BottomTab, Modal, BottomSheet, Embedded. Maps each to CometChat component composition with ASCII layout references." 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 placement stack tabs modal bottomsheet embedded"

Purpose

Teaches Claude the five canonical placement patterns for putting chat inside a React Native app. Each pattern specifies:

  1. Which CometChat components to compose
  2. How to wire the placement into @react-navigation/* (or Expo Router)
  3. Platform gotchas (safe-area, keyboard avoiding, gesture handling)
  4. When to choose this placement over the alternatives

Ground truth: docs/ui-kit/react-native/react-native-conversation.mdx, react-native-one-to-one-chat.mdx, react-native-tab-based-chat.mdx, their expo-*.mdx equivalents, and the examples/SampleApp/ + examples/SampleAppExpo/ sample apps.

Read cometchat-native-core and cometchat-native-components before this skill — the provider wrapper chain and component catalog are prerequisites.


"What are you building?" — placement recommendation

Use this table to pick a placement. If the user says "add chat to my app" without specifying where, ask them what they're building.

User intentRecommended placementExperience
Messaging app (WhatsApp / Telegram / Signal style)Conversations stack — list → tap → full-page messages screenTwo-pane-equivalent on mobile
SaaS / marketplace / e-commerce with chat as a featureStack screen — dedicated /chat or /messages routeFull-page chat inside the app
Support app or focused 1-to-1Stack screen (single thread) — no conversation list, go straight into one chatSingle thread
Full messaging hub with calls / users / groupsBottom tabs — Chats / Users / Groups / Calls tabs + stack screen for message viewTab-based messenger
Occasional chat overlay from a non-chat screenModal — present from anywhere, dismiss to returnModal
Inline comments / contextual chatBottomSheet — swipe up from a screen sectionSheet
Chat embedded inside an existing screen (e.g. a support tab next to product details)Embedded — CometChat components inside a parent layoutEmbedded

Visual reference — five RN placement patterns

1. Stack screen (full page)

┌───────────────────────────────────┐
│ ← Hiking Group               ⋮    │  ← CometChatMessageHeader
├───────────────────────────────────┤
│                                   │
│                ╭──────────╮       │
│                │ Message  │       │
│                ╰──────────╯       │  ← CometChatMessageList
│                                   │
│  ╭──────────╮                     │
│  │ Reply    │                     │
│  ╰──────────╯                     │
│                                   │
├───────────────────────────────────┤
│ +  Type a message...          ▶   │  ← CometChatMessageComposer
└───────────────────────────────────┘

2. Bottom tab

┌───────────────────────────────────┐
│ ← Hiking Group               ⋮    │  ← header
├───────────────────────────────────┤
│                                   │
│           (messages)              │
│                                   │
├───────────────────────────────────┤
│  Chats  Users  Groups  Calls      │  ← bottom tab bar
└───────────────────────────────────┘

3. Modal (slide-up over current screen)

              ┌─────────────────┐
              │ ═══ Chat  ✕     │  ← drag handle + close
              ├─────────────────┤
              │                 │
              │   (messages)    │
              │                 │
              ├─────────────────┤
              │ Type message ▶  │
              └─────────────────┘
  (parent screen dimmed behind)

4. BottomSheet (swipe-up partial)

parent screen visible at top ─────
              ┌─────────────────┐
              │  ═══ (handle)   │
              │ Hiking Group    │
              ├─────────────────┤
              │   (messages)    │
              ├─────────────────┤
              │ Type message ▶  │
              └─────────────────┘

5. Embedded (inside an existing screen)

┌───────────────────────────────────┐
│ Product details                   │
│ [product image + specs]           │
├───────────────────────────────────┤
│ Contact seller                    │  ← section heading
│ ┌────────────────────────────┐    │
│ │ (CometChatMessageHeader)    │    │
│ │ (CometChatMessageList)      │    │  ← embedded chat
│ │ (CometChatMessageComposer)  │    │
│ └────────────────────────────┘    │
└───────────────────────────────────┘

1. Stack screen

The most common pattern — chat lives in its own screen, pushed via @react-navigation/native-stack.

Pattern A — Conversations list → Messages

Two screens: list + messages.

// ConversationsScreen.tsx
import { CometChatConversations, CometChatUiKitConstants } from "@cometchat/chat-uikit-react-native";
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";

export function ConversationsScreen({ navigation }: { navigation: NativeStackNavigationProp<any> }) {
  return (
    <CometChatConversations
      onItemPress={(conversation) => {
        const type = conversation.getConversationType();
        if (type === CometChatUiKitConstants.ConversationTypeConstants.user) {
          navigation.navigate("Messages", { user: conversation.getConversationWith() });
        } else {
          navigation.navigate("Messages", { group: conversation.getConversationWith() });
        }
      }}
    />
  );
}
// MessagesScreen.tsx
import { View 
Read the complete source ↗