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

@rohitkvs/ai-assistant-widget

v1.1.0

Published

A React/Next.js library for AI assistant widget with floating button, voice call, and chat functionality

Readme

AI Assistant Widget

A beautiful, customizable AI assistant widget for React and Next.js applications. Features a floating button with voice call and chat functionality, smooth animations, and flexible positioning.

Features

  • 🎯 Floating Button: Clean, circular floating button with customizable positioning
  • 💬 Chat Interface: Real-time chat with message bubbles and input field
  • 📞 Voice Call Interface: Voice call modal with mute/unmute and end call controls
  • 🎨 Smooth Animations: Beautiful animations powered by Framer Motion
  • 📱 Responsive Design: Works perfectly on desktop and mobile devices
  • ⚙️ Highly Customizable: Flexible positioning and styling options
  • 🔧 TypeScript Support: Full TypeScript support with comprehensive type definitions
  • Framework Agnostic: Works with both React and Next.js
  • 🎨 No Dependencies Required: Includes bundled CSS - no Tailwind CSS needed

Installation

npm install @rohitkvs/ai-assistant-widget
# or
yarn add @rohitkvs/ai-assistant-widget
# or
pnpm add @rohitkvs/ai-assistant-widget

Peer Dependencies

Make sure you have the following peer dependencies installed:

npm install react react-dom framer-motion clsx

Quick Start

React Usage

import React from 'react';
import { AIWidget } from '@rohitkvs/ai-assistant-widget';
import '@rohitkvs/ai-assistant-widget/dist/ai-assistant-widget.css';

function App() {
  return (
    <div>
      {/* Your app content */}
      <h1>My Application</h1>
      
      {/* AI Widget with default positioning (bottom-right) */}
      <AIWidget />
    </div>
  );
}

export default App;

Next.js Usage

// pages/_app.tsx or app/layout.tsx
import { AIWidget } from '@rohitkvs/ai-assistant-widget';
import '@rohitkvs/ai-assistant-widget/dist/ai-assistant-widget.css';

export default function MyApp({ Component, pageProps }) {
  return (
    <>
      <Component {...pageProps} />
      <AIWidget />
    </>
  );
}

Custom Positioning

import { AIWidget } from '@rohitkvs/ai-assistant-widget';
import '@rohitkvs/ai-assistant-widget/dist/ai-assistant-widget.css';

// Bottom-left positioning
<AIWidget position={{ bottom: '24px', left: '24px' }} />

// Top-right positioning
<AIWidget position={{ top: '24px', right: '24px' }} />

// Custom positioning with CSS units
<AIWidget position={{ bottom: '2rem', right: '2rem' }} />

API Reference

AIWidget Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | position | PositionConfig | { bottom: '24px', right: '24px' } | Positioning configuration for the floating button | | className | string | undefined | Additional CSS classes for the floating button |

PositionConfig

interface PositionConfig {
  bottom?: string;
  right?: string;
  left?: string;
  top?: string;
}

Individual Components

You can also import and use individual components:

import { 
  FloatingButton, 
  AIAssistantModal, 
  VoiceCallModal, 
  ChatModal 
} from '@rohitkvs/ai-assistant-widget';
import '@rohitkvs/ai-assistant-widget/dist/ai-assistant-widget.css';

Styling

CSS Import (Required)

Important: You must import the CSS file for the widget to display correctly:

import '@rohitkvs/ai-assistant-widget/dist/ai-assistant-widget.css';

Custom Styling

You can override styles using your own CSS:

/* Custom floating button styling */
.ai-widget-floating-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: none !important;
}

/* Custom modal styling */
.ai-widget-modal {
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

CSS Variables

The widget supports CSS custom properties for easy theming:

:root {
  --ai-widget-primary-color: #3b82f6;
  --ai-widget-background-color: #111827;
  --ai-widget-text-color: #ffffff;
}

Examples

Multiple Widgets

function App() {
  return (
    <div>
      {/* Support widget in bottom-right */}
      <AIWidget />
      
      {/* Sales widget in bottom-left */}
      <AIWidget 
        position={{ bottom: '24px', left: '24px' }}
        className="sales-widget"
      />
    </div>
  );
}

Conditional Rendering

function App() {
  const [showWidget, setShowWidget] = useState(true);
  
  return (
    <div>
      {/* Your app content */}
      
      {showWidget && <AIWidget />}
      
      <button onClick={() => setShowWidget(!showWidget)}>
        Toggle Widget
      </button>
    </div>
  );
}

Browser Support

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

Troubleshooting

Widget Not Showing Correctly

If the widget doesn't display properly, make sure you've imported the CSS file:

import '@rohitkvs/ai-assistant-widget/dist/ai-assistant-widget.css';

TypeScript Issues

Make sure you have the required TypeScript types installed:

npm install --save-dev @types/react @types/react-dom

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see the LICENSE file for details.

Development

Setup

git clone https://github.com/rohitkvs/ai-assistant-widget.git
cd ai-assistant-widget
npm install

Development Server

npm run dev

Build Library

npm run build:lib

Type Checking

npm run type-check

Changelog

v1.1.0

  • Fixed CSS bundling issue
  • Added standalone CSS file
  • Improved documentation
  • Better TypeScript support

v1.0.0

  • Initial release
  • Floating button component
  • AI Assistant modal
  • Voice call interface
  • Chat interface
  • TypeScript support
  • React and Next.js compatibility