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

ai-chatbot-react

v1.0.1

Published

A modern, customizable feature-rich AI chatbot component for React applications with voice input, file upload, and Gemini AI integration

Readme

AI Chatbot React

A modern, customizable feature-rich AI chatbot component for React applications with voice input, file upload, and Gemini AI integration.

Features

  • 🤖 AI Integration: Powered by Google Gemini AI
  • 🎤 Voice Input: Real-time voice recording and transcription
  • 📁 File Upload: Support for document and image uploads
  • 📱 Responsive Design: Works seamlessly on all devices
  • 🎨 Customizable: Highly customizable with Tailwind CSS
  • 📊 Analytics: Built-in analytics and conversation tracking
  • 🔄 Real-time: Live typing indicators and smooth animations
  • 📝 Markdown Support: Rich text formatting with markdown
  • 🎯 TypeScript: Fully typed for better development experience

Installation

npm install ai-chatbot-react
# or
yarn add ai-chatbot-react
# or
pnpm add ai-chatbot-react

Quick Start

1. Set up your Gemini AI API key

Get your API key from Google AI Studio and add it to your environment variables:

NEXT_PUBLIC_GEMINI_API_KEY=your_api_key_here

2. Import and use the chatbot

import { Chatbot, ChatbotProvider } from 'ai-chatbot-react';
import 'ai-chatbot-react/styles';

function App() {
  return (
    <ChatbotProvider>
      <div className="min-h-screen bg-gray-50">
        <Chatbot 
          apiKey={process.env.NEXT_PUBLIC_GEMINI_API_KEY}
          config={{
            title: "AI Assistant",
            placeholder: "Ask me anything...",
            welcomeMessage: "Hello! How can I help you today?"
          }}
        />
      </div>
    </ChatbotProvider>
  );
}

export default App;

Next.js Integration

This package is fully compatible with Next.js projects. Here's how to set it up:

1. Install dependencies

npm install ai-chatbot-react

2. Configure Tailwind CSS (if not already configured)

Add the package's styles to your tailwind.config.js:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    './src/**/*.{js,ts,jsx,tsx,mdx}',
    './node_modules/ai-chatbot-react/dist/**/*.js'
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

3. Import styles

In your main layout or page:

import 'ai-chatbot-react/styles';

4. Use the chatbot

'use client';

import { Chatbot, ChatbotProvider } from 'ai-chatbot-react';

export default function HomePage() {
  return (
    <ChatbotProvider>
      <Chatbot 
        apiKey={process.env.NEXT_PUBLIC_GEMINI_API_KEY}
        config={{
          title: "My AI Assistant",
          placeholder: "Type your message...",
          welcomeMessage: "Hi! I'm here to help."
        }}
      />
    </ChatbotProvider>
  );
}

Advanced Usage

Custom Configuration

import { Chatbot } from 'ai-chatbot-react';

const customConfig = {
  title: "Custom AI Assistant",
  placeholder: "Ask me anything...",
  welcomeMessage: "Welcome! How can I assist you?",
  theme: {
    primary: "#3B82F6",
    secondary: "#1F2937",
    background: "#FFFFFF",
    text: "#1F2937"
  },
  features: {
    voiceInput: true,
    fileUpload: true,
    analytics: true,
    markdown: true
  }
};

<Chatbot apiKey={apiKey} config={customConfig} />

Using Individual Components

import { 
  ChatbotButton, 
  ChatbotWindow, 
  ChatbotMessages,
  useChatbotStore 
} from 'ai-chatbot-react';

function CustomChatbot() {
  const { isOpen, toggleOpen } = useChatbotStore();

  return (
    <div>
      <ChatbotButton onClick={toggleOpen} />
      {isOpen && (
        <ChatbotWindow>
          <ChatbotMessages />
        </ChatbotWindow>
      )}
    </div>
  );
}

API Reference

Chatbot Component

| Prop | Type | Required | Description | |------|------|----------|-------------| | apiKey | string | Yes | Your Gemini AI API key | | config | ChatbotConfig | No | Configuration object |

ChatbotConfig

interface ChatbotConfig {
  title?: string;
  placeholder?: string;
  welcomeMessage?: string;
  theme?: {
    primary?: string;
    secondary?: string;
    background?: string;
    text?: string;
  };
  features?: {
    voiceInput?: boolean;
    fileUpload?: boolean;
    analytics?: boolean;
    markdown?: boolean;
  };
}

Browser Support

  • Chrome 88+
  • Firefox 85+
  • Safari 14+
  • Edge 88+

License

MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions, please open an issue on GitHub.