@epilot360/icons

中文文档
1.18.8发布于 2026/10/29MITTypeScriptCommonJS零依赖近 30 天下载 4.5万

License npm version

原始使用文档
文档目录10 节
  1. Installation
  2. Documentation
  3. Usage
  4. Usage outside 360 portal
  5. Using SVG
  6. Using svgIcon()
  7. Development
  8. Releasing
  9. Adding custom icons (non Material)
  10. Run Locally

@epilot360/icons

License npm version

Curated set of epilot icons based on material-symbols.

Installation

yarn add @epilot360/icons

Documentation

View full list of icons in our Storybook Documentation.

Usage

The @epilot360/icons package is shipped as an external system module in the 360 portal.

You can import any icon as a React component by name:

import { Edit as EditIcon, EpilotIcon } from '@epilot360/icons'

<EditIcon />
// or
<EpilotIcon name="edit" />

Usage outside 360 portal

To avoid bundling the entire @epilot360/icons library, you can import the module directly:

import EditIcon from '@epilot360/icons/react/Edit'
;<EditIcon />

Using SVG

To directly use svg files shipped as part of this package, e.g. with file-loader you can import from:

import EditIconSVG from '@epilot360/icons/svg/Edit/icon.svg'
import EditIconSVGFill from '@epilot360/icons/svg/Edit/icon-fill.svg'
;<img src={EditIconSVG} />

Using svgIcon()

The svgIcon() function returns the raw SVG as a string.

import { svgIcon } from '@epilot360/icons';

<div dangerouslySetInnerHTML={{ __html: svgIcon({ name: 'epilot' }) }} />

<pre>
  {svgIcon({ name: 'epilot', variant: 'filled', width: 48, height: 48, fill: 'white' })}
</pre>

Development

Run storybook locally:

yarn storybook

To add a new icon, modify icons.config.yaml and run the codegen script.

yarn codegen

You should immediately see your new icon.

Releasing

After adding new icons:

  1. Bump the version in both package.json and version.json (including the timestamp)
  2. Commit your changes and push to a new branch
  3. Create a merge request and get it merged to main
  4. After the MR is merged, tag the merge commit on main:
git checkout main
git pull
git tag v<version>
git push origin v<version>

For example:

git tag v1.17.47
git push origin v1.17.47

Adding custom icons (non Material)

First add a custom icon to icons.config.yaml without an svg_import property. This prevents codegen from overriding your custom icon module.

Then add the custom svg. See src/svg/Epilot for an example.

Run Locally

yarn
yarn start
# bundle served at http://localhost:5600/bundle.js

版本与发布记录

@epilot360/icons 共发布 125 个版本,首次发布于 2023/10/20;过去 12 个月发布了 21 个版本。

版本发布日期距今
1.18.8latest2026/10/2915 天前
1.18.72026/10/061 个月前
1.18.62026/10/061 个月前
1.18.42026/09/102 个月前
1.18.22026/07/163 个月前
1.18.12026/06/244 个月前

关于 @epilot360/icons 的常见问题

如何安装 @epilot360/icons?

在项目目录运行 npm install @epilot360/icons,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=17.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@epilot360/icons 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@epilot360/icons 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@epilot360/icons 可以商用吗?

@epilot360/icons 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@epilot360/icons 的下载量有多少?

根据 npm 官方下载统计,@epilot360/icons 在 2026/10/14 – 2026/11/12 这 30 天内被下载 44,750 次,日均约 1,492 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@epilot360/icons 还在维护吗?

最新版本 1.18.8 发布于 2026/10/29(15 天前);至今共发布 125 个版本,其中过去 12 个月发布了 21 个;首次发布于 2023/10/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。