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-bot-snippet

v0.1.5

Published

A package for fast AI Chat for your website

Downloads

101

Readme

ChatBot Angular Component

Description

This is a chat bot component written in Angular that can be integrated into web applications to create an interactive chat with users. The component supports customization of appearance and settings such as colors, sizes, animations, and other parameters.

Features

  • Support for customizing chat appearance (background color, text color, size, and other parameters).
  • Animations for opening and closing the chat window using GSAP.
  • Integration with an API (e.g., using axios) to send messages and receive responses.
  • Message storage using Cookies.
  • Simple API for configuration via @Input parameters.
  • Responsive design support (you can set the chat window and button positions and sizes).

Installation

To install and use the component, follow these steps:

  1. Install dependencies (if not already installed):

    npm install gsap axios js-cookie ai-bot-snippet
  2. Import the component into your Angular project:

    In your module (e.g., app.module.ts), add the import:

    import { ChatBotComponent } from "ai-bot-snippet";

    And add it to the declarations section (if using a regular module) or imports (if it's a standalone component):

    @NgModule({
      declarations: [
        /* other components */
      ],
      imports: [, /* other modules */ ChatBotComponent],
    })
    export class AppModule {}
  3. Use the component in your template:

    <app-chat-bot [aiUrl]="'http://your-api-url.com'" [show]="true" [width]="'350px'" [height]="'450px'" [backgroundColor]="'#fff'" [inputColor]="'#000'" [startMessage]="'Hello! How can I assist you today?'" [btnText]="'Chat with us!'"> </app-chat-bot>

Input Parameters

The component provides many customizable parameters so you can adapt the chat's appearance and behavior to your needs:

  • backgroundColor: The background color of the chat window.
  • inputColor: The color of the text in the input field.
  • botMassageColor: The color of the bot's messages.
  • userMassageColor: The color of the user's messages.
  • sendColor: The color of the send button.
  • scrollbarColor: The color of the scrollbar.
  • scrollbarTrackColor: The color of the scrollbar track.
  • aiUrl: The URL for your API that will handle chat requests.
  • width: The width of the chat window.
  • height: The height of the chat window.
  • startMessage: The message shown when the chat is first opened.
  • btnText: The text on the button to open the chat.
  • show: Determines if the chat window will be shown (true/false).
  • ... and many others.

You can find the full list of parameters in the component code.

Usage

  1. Opening and Closing the Chat: The chat can be opened or closed by clicking the button, which will automatically animate the chat window using toggleChat().

  2. Sending Messages: Messages are sent via the API URL specified in aiUrl. The component sends the user's text and receives a response from the server, which is added to the chat.

  3. Clearing the Chat: You can clear the chat by using the clearChat() method. This will remove all messages and display the initial message.

  4. Animations: The component uses the GSAP library for animations when opening and closing the chat window.

Example

<app-chat-bot [show]="true" [width]="'400px'" [height]="'500px'" [backgroundColor]="'#fff'" [inputColor]="'#333'" [startMessage]="'Welcome to our chat service! How can we assist you today?'" [aiUrl]="'http://api.example.com/chat'" [btnText]="'Open Chat'"> </app-chat-bot>

Notes

  • API: The component sends POST requests to the provided server via axios. You need to configure your server to handle the requests and respond with a message.
  • Cookies: Messages are stored in cookies so that they persist between sessions.

License

This project is licensed under the MIT License.