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

@mxmweb/zui-icons

v1.2.9

Published

基于 Vite + SVGR 的图标库,支持组件化渲染与懒加载索引。

Readme

@mxmweb/zui-icons

基于 Vite + SVGR 的图标库,支持组件化渲染与懒加载索引。

安装

请在宿主项目安装 peer 依赖(版本以你的平台统一为准):

# pnpm(推荐)
pnpm add @mxmweb/zui-icons react react-dom

# 或 yarn
# yarn add @mxmweb/zui-icons react react-dom

# 或 npm
# npm i @mxmweb/zui-icons react react-dom

注意:本包把 reactreact-dom 作为 peerDependencies,不会被打包进来。

使用

  • Icon 组件(按路径渲染)
import { Icon } from '@mxmweb/zui-icons';

export default () => (
  <div>
    <Icon type="rag/pdf" width={24} height={24} />
  </div>
);
  • Icons 索引对象(一次性加载,适用于构建期确定场景)
import { Icons } from '@mxmweb/zui-icons';

const Pdf = (Icons as any).rag?.pdf;

export default () => (Pdf ? <Pdf width={24} height={24} /> : null);
  • LazyIcons 懒加载索引(按需异步加载,首屏更轻)
import { LazyIcons } from '@mxmweb/zui-icons';

const Pdf = (LazyIcons as any).rag?.pdf;

export default () => (
  <React.Suspense fallback={null}>
    {Pdf ? <Pdf width={24} height={24} /> : null}
  </React.Suspense>
);

目录与命名

  • 放置于 src/**/xxx.svg 的图标,会被自动收录为 Icons.<目录>.<文件名>,并可通过 <Icon type="目录/文件名" /> 渲染。
  • 例如:src/rag/pdf.svgIcons.rag.pdf / <Icon type="rag/pdf" />

本地开发

# 安装依赖(在 monorepo 根执行)
pnpm i

# 启动示例(在本包目录)
pnpm -C ui/zui-icons run dev

发布说明

  • 构建产物默认外部化 reactreact-dom 等,不会内联第三方依赖。
  • dist/package.json 会声明 peerDependencies,请确保宿主项目已安装对应版本。