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

@tanzhenxing/zx-title

v1.0.13

Published

zx-title 标题组件

Downloads

11

Readme

zx-title 标题组件

介绍

zx-title 是一个用于显示标题的组件,支持多种标题级别、副标题、图标和右侧操作区域,适用于各种标题展示场景。

基本用法

<zx-title title="标题文本" type="h2"></zx-title>

带图标

<zx-title title="带图标的标题" iconShow icon="home" iconColor="#3c9cff"></zx-title>

带副标题

<zx-title title="主标题" subtitle="副标题描述" type="h2"></zx-title>

带右侧操作

<zx-title title="带操作的标题" rightText="更多" @right="handleRight"></zx-title>

自定义右侧内容

<zx-title title="自定义右侧">
  <template #right>
    <button size="mini" type="primary">操作按钮</button>
  </template>
</zx-title>

自定义样式

<zx-title 
  title="自定义样式" 
  type="h3" 
  color="#ff5500" 
  background="#f8f8f8" 
  padding="20rpx" 
  borderRadius="10rpx">
</zx-title>

API

属性

| 属性名 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | type | String | h2 | 标题级别,可选值:h1、h2、h3、h4、h5 | | title | String | - | 标题内容 | | subtitle | String | - | 副标题内容 | | align | String | left | 对齐方式,可选值:left、center、right | | color | String | #333333 | 标题文字颜色 | | subtitleColor | String | #666666 | 副标题文字颜色 | | bold | Boolean | true | 是否加粗 | | icon | String | - | 图标名称 | | iconShow | Boolean | false | 是否显示图标 | | iconColor | String | #3c9cff | 图标颜色 | | iconSize | String | 40rpx | 图标大小 | | iconWidth | String | - | 图标容器宽度 | | rightText | String | - | 右侧文本 | | rightTextColor | String | #3c9cff | 右侧文本颜色 | | rightTextSize | String | 28rpx | 右侧文本大小 | | margin | String | 0 | 外边距 | | padding | String | 15rpx 0 | 内边距 | | background | String | transparent | 背景颜色 | | borderRadius | String | 0 | 圆角大小 |

事件

| 事件名 | 说明 | 回调参数 | | --- | --- | --- | | right | 点击右侧文本时触发 | - |

插槽

| 名称 | 说明 | | --- | --- | | right | 自定义右侧内容 |

示例代码

<template>
  <view>
    <!-- 基础用法 -->
    <zx-title title="基础标题" type="h2"></zx-title>
    
    <!-- 带图标 -->
    <zx-title 
      title="带图标的标题" 
      iconShow 
      icon="star" 
      iconColor="#ff9900">
    </zx-title>
    
    <!-- 带副标题 -->
    <zx-title 
      title="产品详情" 
      subtitle="了解更多产品信息和使用方法" 
      type="h3" 
      color="#2979ff">
    </zx-title>
    
    <!-- 带右侧文本 -->
    <zx-title 
      title="消息列表" 
      rightText="查看全部" 
      @right="onViewAll">
    </zx-title>
    
    <!-- 自定义右侧内容 -->
    <zx-title title="商品分类">
      <template #right>
        <view class="custom-right">
          <button size="mini" type="primary">筛选</button>
        </view>
      </template>
    </zx-title>
    
    <!-- 自定义样式 -->
    <zx-title 
      title="热门推荐" 
      background="#f5f5f5" 
      padding="20rpx 30rpx" 
      borderRadius="10rpx" 
      iconShow 
      icon="fire" 
      iconColor="#ff5500">
    </zx-title>
  </view>
</template>

<script setup>
const onViewAll = () => {
  uni.navigateTo({
    url: '/pages/message/list'
  });
};
</script>