npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@colossal-sh/chat-react

v0.1.3

Published

React components for embedding the Colossal chat widget: ChatProvider, ChatWidget, and custom output renderers

Downloads

0

Readme

@colossal-sh/chat-react

React components for embedding the Colossal chat widget in your own app: ChatProvider, ChatWidget, and extension points for custom output renderers. Built on the framework-agnostic @colossal-sh/chat-client.

Install

npm install @colossal-sh/chat-react @colossal-sh/chat-client @astryxdesign/core @stylexjs/stylex

Peer dependencies: @astryxdesign/core >=0.1.4, @stylexjs/stylex ^0.19.0, react >=19, react-dom >=19.

Styles

With a bundler (Vite, webpack, …), import one stylesheet:

import "@colossal-sh/chat-react/styles.css";

styles.css pulls in @astryxdesign/core's reset and component CSS from your installed version (via CSS @import, resolved by your bundler) plus the widget styles — so the astryx CSS always matches the astryx components. It also pins the CSS cascade-layer order (@layer properties, reset, theme, base, components, utilities, astryx-base;) so Tailwind v4's preflight cannot override the widget's component styles: without that, a host app that declares Tailwind's base layer after astryx-base strips the widget's paddings, borders, and button backgrounds (a later-declared layer beats specificity).

Without a bundler (e.g. plain <link> tags), or if your app already loads the astryx CSS, load the pieces individually — and if your app uses Tailwind v4, declare that same @layer order in a stylesheet loaded before the astryx CSS:

import "@astryxdesign/core/reset.css";
import "@astryxdesign/core/astryx.css";
import "@colossal-sh/chat-react/widget.css";

Quickstart

import { createChatClient } from "@colossal-sh/chat-client";
import { ChatProvider, ChatWidget } from "@colossal-sh/chat-react";
import "@colossal-sh/chat-react/styles.css";

const chatClient = createChatClient({
  agentUid: "<agent-uid>",
  adapter: { baseUrl: "https://<your-workspace-host>/api/v1" },
});

export function SupportChat() {
  return (
    <ChatProvider client={chatClient}>
      <ChatWidget />
    </ChatProvider>
  );
}

The agentUid is the widget agent's uid, shown on the agent's Embed tab in Colossal. createChatClient accepts the full WidgetConfig from @colossal-sh/chat-client (launcher.position, theme, logoUrl, identity, strings, …). Prefer a module-level client passed via the client prop as above; with the config prop the provider creates the client after the first render, so components that read the chat context on mount (including ChatWidget) throw "must be inside <ChatProvider>" unless you gate them with useHasChatClient().

Customization

ChatProvider props beyond client/config:

  • components — swap built-in UI parts (ChatComponents: launcher, panel header, conversation list item, …).
  • componentRenderers — map an automation output type to your own React component:
<ChatProvider
  config={{ agentUid, adapter: { baseUrl } }}
  componentRenderers={{ warranty_check: WarrantyCard }}
>
  <ChatWidget />
</ChatProvider>

Built-in types you can override: product_list, cart_add / cart_remove, cart_view, order_details, button_link. See Custom components for payload shapes.

  • dataPartRenderers / toolPartRenderers — lower-level stream part rendering.
  • portalTarget — where the widget portal mounts.

Hooks are exported from the ./hooks subpath (useChatClient, useWidgetState, useConversations, useCart, …), and individual building blocks (Launcher, WidgetPanel, ConversationView, Composer, …) from the package root for fully custom layouts.

Documentation

License

MIT