@clearkit/icons

中文文档
2.120.14发布于 2026/10/29MITTypeScriptESM + CJS零依赖近 30 天下载 2637

A directory of ClearKit glyph icons for consumption by the ClearKit React component library.

原始使用文档
文档目录5 节
  1. Adding new icons
  2. Glyphs
  3. Nav
  4. Services
  5. Identity

ClearKit Icon Packages

Icons for consumption by applications that implement ClearKit.

Adding new icons

  1. Icons are created in the ClearKit Figma library and exported as SVGs. The design team is responsible for this process.
  2. Once developer has prepared SVG files from design, then add the SVG file(s) to correct directory inside /packages/icons/icons/* most icons should be added to /glyphs, unless it is a Nav, Service, or Identity icon.
  3. Run yarn setup and yarn start:docs to verify that icon displays properly
  4. Create a pull request and label with "minor" label
  5. Once CI passes, share the Netlify preview link with designer to verify that the icon meets expectations

Glyphs

  • Created on an 18x18 grid
  • Paths should be flattened (unless the glyph should support multi-path)
  • Any fill on exported paths will be stripped in the build process

Multi-path glyphs

Certain glyphs that require multiple fills e.g. an icon with a badge or foreground element, can be exported with multiple paths. When this is done the exported <path> elements should be given class names so they can be targeted in CSS.

Give each <path> a class attribute as follows -

  • Assign base to the path that makes up the base of the glyph
  • Assign modifier to the path that is intended to take a different fill

By default, all path elements will still receive fill="currentColor" so can still be rendered with a single color.

Nav

  • Created on a 22x22 grid
  • Paths should be flattened
  • Any fill on exported paths will be stripped in the build process

Services

  • Created on a 26x26 grid
  • Icons should be exported with their intended fills
  • All fill attributes will be preserved in the build process

Identity

  • Created on a 72x72 grid
  • Icons should be exported with their intended fills
  • All fill attributes will be preserved in the build process

版本与发布记录

@clearkit/icons 共发布 323 个版本,首次发布于 2020/01/28;过去 12 个月发布了 8 个版本。

版本发布日期距今
2.120.14latest2026/10/2912 天前
2.120.132026/09/161 个月前
2.120.112026/02/059 个月前
2.120.102026/01/229 个月前
2.120.92026/01/159 个月前
2.113.12025/12/0511 个月前

其他发布通道:next → 1.4.3-alpha.0。

关于 @clearkit/icons 的常见问题

@clearkit/icons 是什么?

A directory of ClearKit glyph icons for consumption by the ClearKit React component library.

如何安装 @clearkit/icons?

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

@clearkit/icons 支持 TypeScript 吗?

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

@clearkit/icons 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@clearkit/icons 可以商用吗?

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

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

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

@clearkit/icons 还在维护吗?

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