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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@qwertyrioup/gentaur-chatbot

v1.2.1

Published

A customizable React ChatBot component with Socket.IO support - Tailwind v4 compatible

Readme

React ChatBot Component

A customizable React ChatBot component with Socket.IO support, built with TypeScript and Tailwind CSS.

Features

  • 🎨 Fully customizable styling and theming
  • 🔌 Socket.IO integration for real-time messaging
  • 📱 Responsive design with mobile support
  • 🌙 Dark/Light mode support
  • ⚙️ Configurable through props or server config
  • 🎯 TypeScript support
  • 💬 Typing indicators
  • 🏠 Home screen with company branding
  • 📧 Feedback collection for offline scenarios
  • 🔤 Geist Sans font for modern typography

Installation

npm install @your-org/react-chatbot

Usage

Basic Usage

import React from 'react';
import { ChatBot } from '@your-org/react-chatbot';

function App() {
  return (
    <div className="App">
      <ChatBot
        UID="your-bot-unique-id"
        config={{
          companyName: "Your Company",
          botName: "Support Bot",
          primaryColor: "#003299",
          secondaryColor: "#efb100",
          welcomeMessage: "Hello! How can I help you today?",
          placeholder: "Type your message...",
          position: "bottom-right"
        }}
        onMessageSent={(message) => console.log('Sent:', message)}
        onMessageReceived={(message) => console.log('Received:', message)}
        onConnect={() => console.log('Connected')}
        onDisconnect={() => console.log('Disconnected')}
      />
    </div>
  );
}

export default App;

With Custom Styling

import { ChatBot } from '@your-org/react-chatbot';

<ChatBot
  UID="your-bot-id"
  config={{
    companyName: "Acme Corp",
    botName: "Acme Assistant",
    primaryColor: "#ff6b6b",
    secondaryColor: "#4ecdc4",
    width: "400px",
    height: "600px",
    position: "bottom-left",
    theme: "dark"
  }}
  className="custom-chatbot"
/>

Configuration Options

ChatbotConfig Interface

interface ChatbotConfig {
  socketUrl?: string;                    // WebSocket server URL
  companyName?: string;                  // Your company name
  botName?: string;                      // Bot display name
  botAvatar?: string;                    // Bot avatar image URL
  userAvatar?: string;                   // User avatar image URL
  theme?: 'light' | 'dark' | 'auto';    // Color theme
  homeScreenMessage?: string;            // Message on home screen
  presentationMessage?: string;          // Bot introduction message
  primaryColor?: string;                 // Primary theme color (hex)
  secondaryColor?: string;               // Secondary theme color (hex)
  placeholder?: string;                  // Input placeholder text
  height?: string | number;              // Widget height
  width?: string | number;               // Widget width
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
  welcomeMessage?: string;               // First message from bot
  autoConnect?: boolean;                 // Auto-connect to socket
  showTypingIndicator?: boolean;         // Show typing animation
}

Props Interface

interface ChatbotProps {
  UID?: string;                          // Unique identifier for bot config
  config?: ChatbotConfig;                // Configuration options
  onMessageSent?: (message: string) => void;
  onMessageReceived?: (message: Message) => void;
  onConnect?: () => void;
  onDisconnect?: () => void;
  className?: string;                    // Additional CSS classes
}

Styling

The component uses Tailwind CSS for styling. You have several options for customization:

1. Using Config Props

<ChatBot
  config={{
    primaryColor: "#your-primary-color",
    secondaryColor: "#your-secondary-color",
    theme: "dark"
  }}
/>

2. Custom CSS Classes

<ChatBot className="your-custom-class" />

3. CSS Variables

You can override the CSS variables in your global stylesheet:

:root {
  --chatbot-primary: #your-color;
  --chatbot-secondary: #your-color;
  --chatbot-background: #your-color;
}

Server Integration

The component can fetch configuration from a server endpoint:

GET /bot-config/{UID}

Expected response format:

{
  "companyName": "Your Company",
  "botName": "Support Bot",
  "primaryColor": "#003299",
  "secondaryColor": "#efb100",
  "welcomeMessage": "Hello! How can I help you?",
  "autoConnect": true,
  "showTypingIndicator": true
}

Socket.IO Events

The component listens for and emits the following Socket.IO events:

Incoming Events

  • message - Receive messages from server/admin
  • typing - Typing indicator updates
  • guest:joined - Confirmation of chat session creation

Outgoing Events

  • guest:join - Initialize guest chat session
  • guest:message - Send user messages

Development

To build the package locally:

npm install
npm run build

To watch for changes during development:

npm run build:watch

Requirements

  • React >= 16.8.0
  • React DOM >= 16.8.0

Typography

The ChatBot component uses Geist Sans font for modern, clean typography. The font is automatically loaded when the component is rendered, ensuring consistent appearance across different applications.

Dependencies

The component includes these dependencies:

  • socket.io-client
  • lucide-react (for icons)
  • @radix-ui/react-avatar
  • @radix-ui/react-slot
  • class-variance-authority
  • clsx
  • tailwind-merge
  • geist (font package)

License

MIT