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

umi-plugin-icons

v0.1.1

Published

generate React icon from svg

Readme

umi-plugin-icon

更简单的 SVG 图标使用方案。

启用方式

配置开启。

介绍

无需配置 webpack loader,即可在项目中使用 SVG 图标。且支持智能提示、按需引入。

配置

export default {
  icons: {
    // 必填
    entry: path.resolve(__dirname, 'your svg dir'),
    // 是否生成 ts 文件,默认 true
    typescript: true,
    // 图标路径别名,默认 @icons
    alias: '@icons',
  },
};

entry 指定为 SVG 图片文件夹,且该文件夹内的目录结构需要是

- ROOT_SVG_DIR
  - filled
    - yourSVGIcon.svg
  - outlined
    - yourSVGIcon.svg

上面的 filledoutlined 称为「主题」,分别为「填充」和「线性」,因为同一个图标会有两种展示风格,便于后期拓展。

再修改 tsconfig.json,增加 @icons 别名,支持智能提示导入。

{
  "compilerOptions": {
    "paths": {
      "@icons": ["./src/.umi/plugin-icons/index.ts"]
    }
  }
}

使用方式

完成上述配置后,启动项目,将会在 src/.umi 生成 plugin-icons 文件夹,里面存放的就是可使用的图标组件。在代码中,输入 <YourSVGIconOutlined /> 即会出现智能提示。

输入时智能提示

或手动引入

import { YourSVGIconOutlined } from '@icons';

const App = () => {
  return <YourSVGIconOutlined />;
};

@icons 即上述的内置别名,可通过配置项 alias 指定。

FAQ

@ant-design/colors、classnames 依赖找不到

如果安装了 antd,上面两个包就默认安装了,否则需要手动安装。

yarn add @ant-design/colors classnames

输入图标名过程中没有智能提示

确认在 tsconfig.json 中配置了 @icons 别名,如果确认配置但仍无效,尝试先重启一次 vscode。如果还不行,可以先手动引入一次,看 @icons 路径是否识别成功,识别成功后,即可智能提示引入。