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

@hola-ai/chat-widget

v1.0.0

Published

A modern, animated chat interface component for React applications

Readme

Chat AI Plugin

A modern, animated chat interface component for React applications with TypeScript support.

Installation

  1. Install the package and its peer dependencies:
# Using npm
npm install @hola-ai/chat-widget @heroicons/react framer-motion

# Using yarn
yarn add @hola-ai/chat-widget @heroicons/react framer-motion
  1. Add Tailwind CSS configuration:

Make sure you have Tailwind CSS installed and add these configurations to your tailwind.config.js:

module.exports = {
  content: [
    // ...your content configuration
    './node_modules/@hola-ai/chat-widget/**/*.{js,ts,jsx,tsx}'
  ],
  theme: {
    extend: {
      colors: {
        'hola': '#FF6B00',
        'hola-light': '#FF8A33',
        'hola-dark': '#E65D00',
      },
      animation: {
        'fadeIn': 'fadeIn 0.5s ease-in-out',
        'slideDown': 'slideDown 0.3s ease-out',
        'slideUp': 'slideUp 0.3s ease-out',
        'spin-once': 'spin 0.5s ease-in-out',
      },
      keyframes: {
        fadeIn: {
          '0%': { opacity: '0' },
          '100%': { opacity: '1' },
        },
        slideDown: {
          '0%': { transform: 'translateY(-100%)', opacity: '0' },
          '100%': { transform: 'translateY(0)', opacity: '1' },
        },
        slideUp: {
          '0%': { transform: 'translateY(100%)', opacity: '0' },
          '100%': { transform: 'translateY(0)', opacity: '1' },
        },
      },
    },
  },
  plugins: [],
}

Usage

  1. Copy the following components to your project:
  • src/components/ChatWidget/ChatBox.tsx
  • src/components/ChatWidget/MessageBubble.tsx
  • src/components/ChatWidget/WelcomeMessage.tsx
  • src/components/Icons/HolaAILogo.tsx
  1. Import and use the ChatBox component in your React application:
import { useState } from 'react';
import ChatBox from './components/ChatWidget/ChatBox';

const App = () => {
  const [showChat, setShowChat] = useState(false);

  return (
    <div className="relative">
      {/* Chat toggle button */}
      <button
        onClick={() => setShowChat(!showChat)}
        className="fixed bottom-4 right-4 p-4 bg-hola text-white rounded-full shadow-lg hover:bg-hola-dark transition-colors"
      >
        Chat with AI
      </button>

      {/* Chat box */}
      {showChat && (
        <div className="fixed bottom-20 right-4 w-[400px] h-[600px]">
          <ChatBox 
            onClose={() => setShowChat(false)}
            title="Chat with Hola-AI"
          />
        </div>
      )}
    </div>
  );
};

export default App;

Features

  • 🎨 Modern UI with smooth animations
  • 💬 Welcome message with typing effect
  • 🚀 Quick action buttons
  • ⌨️ Real-time typing indicators
  • 📱 Responsive design
  • 🎯 Easy to customize

Props

The ChatBox component accepts the following props:

| Prop | Type | Description | |------|------|-------------| | onClose | () => void | Callback function when the close button is clicked | | title | string | Title displayed in the chat header |

Customization

  1. Quick Actions: Modify the quick action buttons in ChatBox.tsx:
<button 
  onClick={() => handleQuickAction("Your custom message")}
  className="px-4 py-2 bg-white rounded-full text-sm text-hola whitespace-nowrap border border-hola hover:bg-orange-50 transition-all hover:scale-105"
>
  Custom Button
</button>
  1. AI Response: Update the response messages in the simulateResponse function in ChatBox.tsx:
const responses = [
  "Your custom response 1",
  "Your custom response 2",
  // Add more responses
];
  1. Styling:
  • Modify colors in tailwind.config.js
  • Update component styles using Tailwind classes
  • Customize animations in the theme configuration

Integration with AI Backend

To integrate with your AI backend:

  1. Replace the simulateResponse function in ChatBox.tsx:
const simulateResponse = async () => {
  setIsTyping(true);
  try {
    const response = await fetch('your-api-endpoint', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ message }),
    });
    
    const data = await response.json();
    
    setMessages(prev => [...prev, {
      id: Date.now().toString(),
      text: data.response,
      isUser: false,
      timestamp: formatTimestamp()
    }]);
  } catch (error) {
    console.error('Error:', error);
    // Handle error appropriately
  } finally {
    setIsTyping(false);
  }
};

Notes

  • The component uses Tailwind CSS for styling
  • Framer Motion is used for animations
  • The chat interface is designed to be responsive and mobile-friendly
  • Make sure to handle API errors and loading states appropriately when integrating with your backend