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-header

v1.0.0

Published

Chat Header component for RongXiaoBao

Readme

rt-chat-header

一个基于 Vue 3 的聊天应用顶部导航组件,专为移动端 H5 聊天场景设计。提供侧边栏切换、标题展示、深色模式支持以及灵活的右侧操作区插槽。

特性

  • 📱 移动端适配:响应式布局,完美适配移动端沉浸式体验。
  • 🌓 主题支持:内置 Light/Dark 模式支持,自动处理毛玻璃效果与边框颜色。
  • 🧩 开箱即用:零配置即可使用,内置标准 SVG 菜单图标。
  • 🔌 灵活扩展:提供 actions 插槽,方便集成“模式切换”、“更多菜单”等功能。

安装

npm install rt-chat-header
# 或
yarn add rt-chat-header

快速使用

<template>
  <div>
    <!-- 顶部导航 -->
    <ChatHeader
      title="荣小宝"
      :is-dark="isDark"
      @toggle-sidebar="handleToggleSidebar"
    >
      <!-- 右侧插槽:例如放置一个模式切换按钮 -->
      <template #actions>
        <button @click="switchMode">切换模式</button>
      </template>
    </ChatHeader>

    <div class="content">
      <!-- 页面主体内容 -->
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import { ChatHeader } from "rt-chat-header";
import "rt-chat-header/style.css"; // 务必引入样式

const isDark = ref(false);

const handleToggleSidebar = () => {
  console.log("切换侧边栏");
};

const switchMode = () => {
  console.log("切换模式");
};
</script>

API 文档

Props

| 属性名 | 类型 | 默认值 | 说明 | | -------- | --------- | ------- | ------------------------------------------------ | | title | string | "" | 导航栏标题文本 | | isDark | boolean | false | 是否为深色模式(影响背景毛玻璃、文字颜色和边框) |

Events

| 事件名 | 参数 | 说明 | | ---------------- | ---- | ---------------------- | | toggle-sidebar | - | 点击左侧菜单按钮时触发 |

Slots

| 插槽名 | 说明 | | --------- | ---------------------------------------- | | actions | 导航栏右侧区域,用于放置自定义按钮或组件 |

样式定制

组件使用了 Tailwind CSS 风格的样式类,并预置了毛玻璃效果。

  • 高度:固定为 3rem (12),如有需要可通过覆盖 CSS 修改。
  • 层级z-index: 30,确保悬浮在内容之上。

License

MIT