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

rankflow-chatbot-widget

v0.1.7

Published

A customizable, reusable chatbot component for React and Next.js

Readme

RankFlow Chatbot Widget

A customizable, production-ready chatbot component for React and Next.js applications. Designed for seamless integration, high performance, and deep customizability.

npm version License: MIT

Features

  • TypeScript Native: Full type safety for props and themes.
  • Streaming Markdown: Real-time rendering of AI responses with Vercel's Streamdown.
  • Code Syntax Highlighting: Professional code blocks with Shiki (requires enableCodeHighlighting).
  • Dynamic Textarea: Smart auto-expanding input field with support for multiline messages.
  • Persistence: Optional message history persistence using localStorage.
  • Theming API: Granular control over colors, sizing, and positioning.

Installation

npm install rankflow-chatbot-widget

Quick Start

Basic Usage

import { Chatbot } from 'rankflow-chatbot-widget';

const App = () => {
  const handleSendMessage = async (text: string) => {
    const response = await api.chat({ message: text });
    return response.content;
  };

  return (
    <Chatbot
      botName="RankFlow Support"
      onSendMessage={handleSendMessage}
      welcomeMessage="Hi! How can I assist you today?"
    />
  );
};

Streaming Example (Markdown & Code Highlighting)

import { Chatbot } from 'rankflow-chatbot-widget';

const App = () => {
  const handleStreamingMessage = async (text: string, updateMessage: (chunk: string) => void) => {
    // Example using an AI SDK that supports streaming
    const response = await fetch('/api/chat', {
       method: 'POST',
       body: JSON.stringify({ message: text })
    });
    
    const reader = response.body?.getReader();
    const decoder = new TextDecoder();
    
    while (true) {
      const { done, value } = await reader.read();
      if (done) break;
      const chunk = decoder.decode(value);
      updateMessage(chunk); // Update the UI in real-time
    }
  };

  return (
    <Chatbot
      botName="Assistant"
      enableStreaming={true}
      enableMarkdown={true}
      enableCodeHighlighting={true}
      onSendMessage={handleStreamingMessage}
    />
  );
};

API Reference

Component Props

| Property | Type | Default | Description | | :--- | :--- | :--- | :--- | | onSendMessage | (msg: string, update?: (chunk: string) => void) => Promise<string \| void> | Required | Async function called when a message is sent. Supports streaming if enableStreaming is true. | | enableStreaming | boolean | false | Enable support for chunk-based message updates (useful for LLMs). | | enableMarkdown | boolean | false | Renders bot responses using Markdown. | | enableCodeHighlighting | boolean | false | Enables syntax highlighting for code blocks (requires enableMarkdown). | | botName | string | "AI Agent" | Header display name. | | welcomeMessage | string | (Contextual) | Initial greeting message. | | Logo | string \| ReactNode | null | Header logo (URL string or React component). | | placeholder | string | "Type your message..." | Input field placeholder text. | | position | ChatPosition | "bottom-right" | Window placement on screen. | | persistMessages | boolean | false | Enable/disable message history persistence. | | showBranding | boolean | true | Toggle the "Powered by RankFlow" branding footer. | | maxMessages | number | 100 | Maximum number of messages kept in history. | | theme | ChatbotTheme | {} | Customization object for UI elements. | | onMessageSent | (msg: Message) => void | undefined | Callback fired when user sends a message. | | onMessageReceived | (msg: Message) => void | undefined | Callback fired when bot responds. |

Theme Configuration

The theme prop allows you to override default styles to match your application's design system.

const customTheme = {
  primaryColor: '#000000',     // Header and primary actions
  backgroundColor: '#ffffff',  // Chat window background
  userMessageColor: '#000000', // User message bubble background
  botMessageColor: '#f3f4f6',  // Bot message bubble background
  textColor: '#1f2937'         // Main text color
};

Technical Details

  • Built with: React, TypeScript, and Tsup.
  • Compatibility: React 16.8+ (Hooks required).
  • Styling: Inline styles for maximum compatibility across different build environments (no external CSS dependencies).

License

MIT © Aditya