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

nui-chatbot-pkg

v1.0.15

Published

A customizable, meaningful, and easy-to-integrate Chatbot component for React applications with support for custom components, theming, and streaming responses.

Readme

NUI Chatbot Package

A customizable, meaningful, and easy-to-integrate Chatbot component for React applications with support for custom components, theming, and streaming responses.

Installation

npm install nui-chatbot-pkg

Requirements

  • React 18+
  • React DOM 18+
  • Tailwind CSS 3+

Quick Start

Basic Setup

"use client";

import { ChatBot } from "nui-chatbot-pkg";
import "nui-chatbot-pkg/style.css"; // Required for styles

export default function ChatPage() {
  return (
    <div className="min-h-screen flex items-center justify-center">
      <ChatBot
        strapiUrl="http://localhost:1337"
        cardRegistry={[]}
        theme={{
          primaryColor: "#30b3ebff",
          secondaryColor: "#2281f4ff",
          accentColor: "#38c7daff",
        }}
        title="My Chatbot"
      />
    </div>
  );
}

Component Registry

The component registry allows you to define custom card components for different data types. Each component in the registry will be rendered based on the id matching the response type.

Setup Example

import DealCard from "./components/DealCard";
import EmployeeCard from "./components/EmployeeCard";
import TourCard from "./components/TourCard";
import GenericCard from "./components/GenericCard";

const registryData = [
  { id: "card1", component: DealCard },
  { id: "card2", component: EmployeeCard },
  { id: "card3", component: TourCard },
  { id: "default", component: GenericCard }, 
];

Custom Card Component Example

interface CardProps {
  data: any;
}

export default function DealCard({ data }: CardProps) {
  return (
    <div className="bg-white rounded-lg p-4 shadow-md">
      <h3 className="font-bold text-lg">{data.title}</h3>
      <p className="text-gray-600">{data.description}</p>
      <p className="text-blue-600 font-semibold mt-2">{data.price}</p>
    </div>
  );
}

Theme Configuration

Customize the chatbot's appearance with the theme object:

const customTheme = {
  primaryColor: "#30b3ebff", // Main color for buttons and accents
  secondaryColor: "#2281f4ff", // Secondary accent color
  accentColor: "#38c7daff", // Additional accent color
  container: "rounded-2xl border-blue-500", // Tailwind classes for container
  header: "text-white", // Tailwind classes for header
  input: "border-blue-400 rounded-xl", // Tailwind classes for input
  showGradient: false, // Enable/disable gradient backgrounds
  welcomeMessage: "Welcome!", // Greeting message
  welcomeDescription: "How can I help?", // Subtitle message
};

<ChatBot
  theme={customTheme}
  // ... other props
/>;

Props Reference

| Prop | Type | Required | Description | | -------------- | ------------------------------------------------------- | -------- | -------------------------------------------------------- | | strapiUrl | string | ✓ | URL of your Strapi backend API | | cardRegistry | Array<{ id: string; component: React.ComponentType }> | ✓ | Registry of custom card components | | theme | object | ✓ | Theme configuration object | | title | string | ✓ | Title displayed in the chat window header | | streamSpeed | number | - | Speed of message streaming in milliseconds (default: 10) |

Complete Example

"use client";

import { useEffect, useState } from "react";
import { ChatBot } from "nui-chatbot-pkg";
import "nui-chatbot-pkg/style.css"; 
import DealCard from "../../components/Cards/DealCard/DealCard";
import EmployeeCard from "../../components/Cards/EmployeeCard/EmployeeCard";
import TourCard from "../../components/Cards/TourCard/TourCard";
import GenericCard from "../../components/Cards/GenericCard/GenericCard";

const registryData = [
  { id: "card1", component: DealCard },
  { id: "card2", component: EmployeeCard },
  { id: "card3", component: TourCard },
  { id: "default", component: GenericCard },
];

const customTheme = {
  primaryColor: "#30b3ebff",
  secondaryColor: "#2281f4ff",
  accentColor: "#38c7daff",
  container: "rounded-2xl border-blue-500",
  header: "text-white",
  input: "border-blue-400 rounded-xl",
  showGradient: false,
  welcomeMessage: "Welcome to Numentica-UI",
  welcomeDescription: "How can I help you today?",
};

export default function ChatPage() {
  return (
    <div className="bg-[#000000] min-h-screen flex items-center justify-center p-4">
      <ChatBot
        strapiUrl="http://localhost:1337"
        cardRegistry={registryData}
        theme={customTheme}
        title="Numentica-UI"
        streamSpeed={10}
      />
    </div>
  );
}

Features

  • 🎨 Easy theming with customizable colors
  • 🧩 Component registry for custom card rendering
  • 💬 Real-time message streaming
  • 📱 Responsive design with Tailwind CSS
  • ⚙️ Flexible configuration
  • 🚀 Optimized for Next.js with "use client" directive

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT