🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@cometchat/cards-react

Package Overview
Dependencies
Maintainers
14
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cometchat/cards-react

CometChat Card Schema renderer — React wrapper

latest
npmnpm
Version
1.0.0
Version published
Maintainers
14
Created
Source

CometChat Card Renderer React

A React component for rendering CometChat Card Schema JSON. This is a thin wrapper around @cometchat/cards that mounts the vanilla DOM output into a React component with full lifecycle management.

What it does

  • Renders Card Schema JSON as a native React component
  • Reactively re-renders on prop changes (cardJson, themeMode, themeOverride, logLevel)
  • Automatically cleans up DOM and theme observers on unmount
  • Emits clicks on buttons, icon buttons, and links to your callback as typed CometChatCardActionEvents

The package is a pure renderer. It doesn't talk to the CometChat SDK, doesn't manage message lifecycle, and doesn't know about your app's routing. You decide what each action does.

Installation

npm install @cometchat/cards-react

@cometchat/cards-react includes @cometchat/cards as a dependency — no need to install both.

Peer Dependencies

  • react >= 17.0.0
  • react-dom >= 17.0.0

Usage

import { CometChatCardView } from "@cometchat/cards-react";

function CardMessage({ cardJson }: { cardJson: string }) {
  return (
    <CometChatCardView
      cardJson={cardJson}
      themeMode="auto"
      onAction={(event) => {
        console.log("action:", event.action.type, "from", event.elementId);
      }}
    />
  );
}

Getting Started

Refer to the Integration Steps to integrate the react cards into your app.

Prerequisites

  • Node.js >= 14.17.0
  • npm >= 7
  • React >= 17.0.0

Help and Support

For integration issues, create a support ticket or seek real-time support via the CometChat Dashboard.

Keywords

cometchat

FAQs

Package last updated on 27 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts