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

react-sigma-chatbox

v1.0.5

Published

A high-quality React chatbox library featuring product cards, quick replies, and AI integration.

Readme

React Sigma Chatbox ✨

A high-performance, modern React Chatbox UI library inspired by the Bitu AI assistant (FPT Shop). It features a sleek design, support for product carousels, quick replies, and built-in compatibility with the Gemini AI streaming API.


🚀 Development Setup

If you have cloned this repository and want to run the demo or continue development:

  1. Install dependencies:

    npm install
  2. Run the development server:

    npm run dev

    The demo application will be available at http://localhost:5173.

  3. Build the library:

    npm run build

    This generates the dist folder containing the compiled library (index.mjs, index.js) and the bundled CSS (react-sigma-chatbox.css).


📦 Integrating into Another Local Project

1. Link or Copy the Library

You can use the library in your other local projects before it's published to NPM:

Option A: NPM Link

  1. In the react-sigma-chatbox directory: npm link
  2. In your target project directory: npm link react-sigma-chatbox

Option B: Manual Copy Copy the dist folder directly into your project and import from it.

2. Tailwind CSS Configuration

To ensure the chatbox styles are correctly applied in your target project, update your tailwind.config.js:

/** @type {import('tailwindcss').Config} */
export default {
  content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    "./node_modules/react-sigma-chatbox/**/*.{js,ts,jsx,tsx}", 
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

3. Import Styles

Import the library's stylesheet in your entry file (e.g., main.tsx or App.tsx):

import 'react-sigma-chatbox/dist/react-sigma-chatbox.css';

🛠 Basic & Streaming Usage

The Chatbox component is highly flexible and handles logic through a threadId (unique session ID) and a language parameter (en, vi, ja). Both change or get passed whenever the user interacts with the UI.

Option 1: Standard Text Response (Plain Text or Markdown)

You can choose to render responses as plain text (default) or basic Markdown (Bold, Lists, etc.).

import { Language } from 'react-sigma-chatbox';

const config = {
  // ... other config
  renderMarkdown: true // Set to true to enable Markdown rendering
};

// Handler now receives (userInput, threadId, language)
const handleSimpleAi = async (userInput: string, threadId: string, language: Language) => {
  console.log(`Session ID: ${threadId}, Selected Language: ${language}`);
  
  if (language === 'vi') {
    return "Xin chào! Tôi là **trợ lý AI**. Tôi có thể giúp gì cho bạn?";
  }
  return "Hello! I am your **AI assistant**. How can I help you today?";
};

<Chatbox onGetAiResponse={handleSimpleAi} config={config} />

⚙️ Component Configuration

Chatbox Props

| Prop | Type | Description | | :--- | :--- | :--- | | config | ChatboxConfig | Object containing UI branding and initial messages. | | onGetAiResponse | AiResponseHandler | Logic handler receiving (userInput, threadId, language). |

ChatboxConfig Fields

| Field | Type | Description | | :--- | :--- | :--- | | primaryColor | string | Hex color used for accents and user bubbles. | | botName | string | The display name shown in the header. | | welcomeMessage | Translatable<string> | Initial message sent by the bot. Automatically updates when language is changed before the conversation starts. | | description | Translatable<string> | Text displayed in the introduction section (avatar area). Supports bold markdown. | | placeholder | Translatable<string> | Input field placeholder text. | | avatarUrl | string | URL for the bot icon. | | quickReplies | Translatable<string[]> | List of one-tap answer buttons. | | renderMarkdown | boolean | Enable Markdown support for AI messages, including Tables. |

Dynamic Multilingual Support (Translatable<T>)

The fields welcomeMessage, description, placeholder, and quickReplies support multilingual configuration. You can pass a simple value or an object mapped to vi, en, or ja.

const config: ChatboxConfig = {
  // Simple value
  botName: 'Sigma Assistant',
  
  // Multilingual Object
  welcomeMessage: {
    vi: 'Chào bạn! Tôi có thể giúp gì cho bạn?',
    en: 'Hello! How can I help you today?',
    ja: 'こんにちは!今日はどのようなお手伝いができますか?'
  },

  description: {
    vi: '**Sigma Assistant** hỗ trợ bạn mọi lúc mọi nơi',
    en: '**Sigma Assistant** supports you anytime, anywhere'
  },
  
  placeholder: {
    vi: 'Nhập tin nhắn...',
    en: 'Type a message...'
  },
  
  quickReplies: {
    vi: ['Giá iPhone 15', 'Bảo hành'],
    en: ['iPhone 15 Price', 'Warranty']
  }
};

📄 License

MIT