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

vue-robot-chat-plugin

v1.0.2

Published

A Vue3 robot chat plugin with draggable icon and dialog, built with Element Plus

Readme

Vue Robot Chat Plugin

A lightweight, draggable robot chat plugin for Vue 3 with Element Plus. Features a floating robot icon with position memory and a customizable dialog.

Features

  • 🤖 Draggable Robot Icon - Free drag with localStorage position memory
  • 💬 Customizable Dialog - Title bar drag support, theme color customization
  • 📱 Touch-Friendly - Works on both desktop and mobile devices
  • 🎨 Style Isolation - No global style pollution
  • 📦 Dual Format - ESM + UMD output
  • 🔷 TypeScript - Full type definitions included
  • Zero Dependencies - Peer dependencies only (Vue 3, Element Plus)

Installation

npm install vue-robot-chat-plugin element-plus

Quick Start

Method 1: Programmatic Usage (Recommended)

import { init, destroy } from 'vue-robot-chat-plugin'
import 'vue-robot-chat-plugin/style.css'

// Initialize the plugin
const plugin = init({
  icon: {
    size: 56,
    color: '#409eff',
    initialPosition: 'bottom-right'
  },
  dialog: {
    width: 400,
    height: 500,
    title: 'AI Assistant',
    themeColor: '#409eff'
  },
  onIconClick: () => {
    console.log('Icon clicked!')
  },
  onDialogOpen: () => {
    console.log('Dialog opened!')
  },
  onDialogClose: () => {
    console.log('Dialog closed!')
  }
})

// Show/hide dialog programmatically
plugin.showDialog()
plugin.hideDialog()
plugin.toggleDialog()

// Destroy the plugin when done
destroy()

Method 2: Vue Plugin Installation

import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import VueRobotChatPlugin from 'vue-robot-chat-plugin'
import 'vue-robot-chat-plugin/style.css'

const app = createApp(App)

app.use(ElementPlus)
app.use(VueRobotChatPlugin, {
  icon: {
    size: 60,
    color: '#667eea'
  },
  dialog: {
    title: 'Chat Bot',
    themeColor: '#667eea'
  }
})

Method 3: Component Usage

<template>
  <div>
    <RobotIcon
      :size="56"
      color="#409eff"
      initial-position="bottom-right"
      @click="handleIconClick"
    />
    <ChatDialog
      v-model="dialogVisible"
      :width="400"
      :height="500"
      title="AI Assistant"
      theme-color="#409eff"
      @close="handleClose"
    >
      <!-- Your custom content -->
      <div>Your chat content here</div>

      <!-- Custom footer -->
      <template #footer>
        <button @click="dialogVisible = false">Close</button>
      </template>
    </ChatDialog>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { RobotIcon, ChatDialog } from 'vue-robot-chat-plugin'
import 'vue-robot-chat-plugin/style.css'

const dialogVisible = ref(false)

const handleIconClick = () => {
  dialogVisible.value = !dialogVisible.value
}

const handleClose = () => {
  console.log('Dialog closed')
}
</script>

API Reference

init(options?: PluginOptions)

Initialize the plugin programmatically.

interface PluginOptions {
  icon?: RobotIconOptions
  dialog?: DialogOptions
  onIconClick?: () => void
  onDialogOpen?: () => void
  onDialogClose?: () => void
}

interface RobotIconOptions {
  size?: number          // Default: 56
  color?: string         // Default: '#409eff'
  initialPosition?: 'bottom-right' | 'bottom-left'  // Default: 'bottom-right'
}

interface DialogOptions {
  width?: string | number   // Default: 400
  height?: string | number  // Default: 500
  title?: string            // Default: 'AI Assistant'
  themeColor?: string       // Default: '#409eff'
}

destroy()

Completely remove the plugin (removes DOM, events, and listeners).

showDialog()

Programmatically show the dialog.

hideDialog()

Programmatically hide the dialog.

toggleDialog()

Toggle dialog visibility.

Components

<RobotIcon />

| Prop | Type | Default | Description | |------|------|---------|-------------| | size | number | 56 | Icon size in pixels | | color | string | '#409eff' | Icon color | | initialPosition | 'bottom-right' \| 'bottom-left' | 'bottom-right' | Initial position |

| Event | Payload | Description | |-------|---------|-------------| | click | - | Emitted when icon is clicked (not dragged) | | drag-end | DragPosition | Emitted when drag ends |

<ChatDialog />

| Prop | Type | Default | Description | |------|------|---------|-------------| | modelValue | boolean | false | Dialog visibility (v-model) | | width | string \| number | 400 | Dialog width | | height | string \| number | 500 | Dialog height | | title | string | 'AI Assistant' | Dialog title | | themeColor | string | '#409eff' | Theme color |

| Event | Payload | Description | |-------|---------|-------------| | update:modelValue | boolean | Visibility change | | open | - | Dialog opened | | close | - | Dialog closed |

| Slot | Description | |------|-------------| | default | Dialog body content | | footer | Dialog footer content |

Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Publishing to npm

# Build the package
npm run build

# Publish to npm
npm publish

Browser Support

  • Chrome >= 87
  • Firefox >= 78
  • Safari >= 14
  • Edge >= 88

License

MIT