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

rt-chat-sidebar

v1.0.1

Published

AI对话侧边栏组件,支持对话管理、历史记录展示、独立弹窗交互

Readme

rt-chat-sidebar

一个基于 Vue 3 的 AI 聊天应用侧边栏组件,提供开箱即用的对话管理、历史记录展示、用户菜单等功能。

该组件不依赖 Element Plus,内部实现了自定义弹窗(确认对话框、输入对话框)和上下文菜单,体积轻量,样式可定制。

特性

  • 📂 对话管理:支持置顶对话和最近对话列表
  • 🖱️ 交互友好:支持右键/长按弹出上下文菜单(重命名、删除)
  • 📱 响应式设计:完美支持移动端和桌面端
  • 🎨 主题定制:内置亮色/深色主题,支持 CSS 变量定制
  • 🧩 独立弹窗:内置 ConfirmDialog 和 PromptDialog,无需额外引入 UI 库

安装

npm install rt-chat-sidebar
# 或者
pnpm add rt-chat-sidebar

快速上手

<template>
  <ChatSidebar
    v-model:open="sidebarOpen"
    :conversations="conversations"
    :current-conversation-id="currentId"
    :user="user"
    @new-chat="handleNewChat"
    @select="handleSelect"
    @delete="handleDelete"
    @rename="handleRename"
  />
</template>

<script setup>
import { ref } from "vue";
import { ChatSidebar } from "rt-chat-sidebar";
import "rt-chat-sidebar/style.css";

const sidebarOpen = ref(true);
const currentId = ref("1");
const conversations = ref([
  { id: "1", title: "Hello World" },
  { id: "2", title: "Vue 3 Support" },
]);
const user = { username: "Admin", avatar: "" };

const handleNewChat = () => {
  /* ... */
};
const handleSelect = (id) => {
  currentId.value = id;
};
const handleDelete = (id) => {
  /* remove conversation */
};
const handleRename = (id, newTitle) => {
  /* update title */
};
</script>

API

Props

| 属性名 | 类型 | 默认值 | 说明 | | ----------------------- | ------------------- | ------------ | ---------------------- | | open (v-model) | boolean | false | 侧边栏展开状态 | | conversations | Conversation[] | [] | 对话列表数据 | | currentConversationId | string | undefined | 当前选中的对话 ID | | pinnedConversations | Conversation[] | [] | 置顶的对话列表 | | appName | string | 'Chat App' | 应用名称 | | appLogo | string | - | 应用 Logo URL | | appVersion | string | - | 版本号显示 | | user | User | - | 用户信息对象 | | loading | boolean | false | 新建对话按钮的加载状态 | | hasMore | boolean | false | 是否有更多历史记录 | | isLoadingMore | boolean | false | 是否正在加载更多 | | showProfile | boolean | true | 是否显示底部用户区 | | theme | 'light' \| 'dark' | 'light' | 主题模式 |

Events

| 事件名 | 参数 | 说明 | | -------------- | -------------------------------- | -------------------------- | | update:open | (value: boolean) | open 状态更新时触发 | | toggle | - | 点击关闭/切换按钮时触发 | | new-chat | - | 点击新建对话按钮时触发 | | select | (id: string) | 点击某个对话时触发 | | delete | (id: string) | 在弹窗中确认删除时触发 | | rename | (id: string, newTitle: string) | 在弹窗中确认重命名时触发 | | toggle-theme | - | 点击主题切换按钮时触发 | | logout | - | 在弹窗中确认退出登录时触发 | | load-more | - | 滚动到底部时触发 |

类型定义

export interface Conversation {
  id: string;
  title: string;
  is_pinned?: boolean;
  updated_at?: string;
}

export interface User {
  username: string;
  nickname?: string;
  avatar?: string;
}

主题定制

组件使用 CSS 变量定义颜色,你可以在 CSS 中覆盖它们:

:root {
  --cs-brand: #3b82f6; /* 主题色 */
  --cs-bg-primary: #ffffff; /* 背景色 */
  --cs-text-primary: #1e293b; /* 文字颜色 */
  /* 更多变量参考 src/styles/variables.css */
}