@autoguru/icons

中文文档
2.2.0发布于 2026/06/23MITTypeScriptESM + CJS构建来源已验证近 30 天下载 1824

Icons and illustrations that support product at AutoGuru

原始使用文档
文档目录9 节
  1. Install
  2. Usage
  3. Naming
  4. Categories
  5. Finding an icon
  6. Contributing
  7. Adding an icon
  8. Building
  9. License

@autoguru/icons

Icons and illustrations that support product at AutoGuru.

npm license

A tree-shakeable React icon library combining bespoke AutoGuru icons with the Phosphor icon set, mirroring the AutoGuru Design System. Every icon is an individual component, so you only ship what you import.

  • 1,500+ icons across 20 categories — see the category reference
  • Tree-shakeable — sideEffects: false, one component per icon
  • Themeable — icons inherit colour via currentColor and scale to any size
  • Typed — ships TypeScript definitions for every icon

Install

yarn add @autoguru/icons react

react (>=16.8) is a peer dependency.

Usage

Icons are React components. Render them through the Icon component from @autoguru/overdrive:

import { UserSquareIcon } from '@autoguru/icons';
import { Icon } from '@autoguru/overdrive';

<Icon icon={UserSquareIcon} size={16} />;

Or render directly — icons take currentColor, so colour and size are controlled by their container:

import { CarIcon } from '@autoguru/icons';

<span style={{ color: 'tomato', width: 24, height: 24, display: 'inline-flex' }}>
    <CarIcon />
</span>;

Naming

Each icon is exported as PascalCase + Icon, derived from its kebab-case source filename:

Source SVGExport
arrow-left.svgArrowLeftIcon
user-square.svgUserSquareIcon
magnifying-glass.svgMagnifyingGlassIcon

Categories

All 1,577 icons are grouped into 20 categories. Open the category reference for the full illustrated index (every icon with a preview and its export name), or jump straight to a category:

CategoryIconsCategoryIcons
AutoGuru45Filled9
Arrows121Brands89
Commerce176Communication73
Design133Development29
Education19Games73
Health & Wellness27Maps & Travel99
Math & Finance83Media111
Office & Editing131People69
Security & Warnings44System & Devices156
Time28Weather & Nature62

Finding an icon

Contributing

Adding an icon

  1. Drop the optimised SVG into icons/ with a kebab-case filename (e.g. car-key.svg). The filename becomes the export name — car-key.svg → CarKeyIcon.

  2. Keep the source clean: a single viewBox, currentColor / black fills, none strokes, and no inline width/height. SVGs are run through svgo during the build, but we want the source tidy too.

  3. Add the icon's category to categories/categories.json ("car-key": "AutoGuru"), then refresh the reference:

    node categories/generate.js   # regenerates the category reference
    
  4. Run yarn build.

The base icon set was sourced from Phosphor (regular weight) plus bespoke AutoGuru designs; those SVGs now live directly in icons/, so there's no external icon dependency.

Building

yarn generate   # SVGs -> React components + index.ts
yarn build      # generate, then compile CJS + ESM + type definitions

scripts/build.js turns the SVGs into components and the generated index.ts. The categories/ reference is separate, standalone documentation produced by categories/generate.js from categories/categories.json — it is not part of the build and the package exports no category metadata.

License

MIT © AutoGuru

AutoGuru

版本与发布记录

@autoguru/icons 共发布 126 个版本,首次发布于 2019/08/26;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.2.0latest2026/06/234 个月前
2.1.02026/06/174 个月前
2.0.12026/06/094 个月前
2.0.02026/06/094 个月前
1.8.222026/04/176 个月前
1.8.212026/04/176 个月前

其他发布通道:next → 2.0.0-rc-03。

关于 @autoguru/icons 的常见问题

@autoguru/icons 是什么?

Icons and illustrations that support product at AutoGuru

如何安装 @autoguru/icons?

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

@autoguru/icons 支持 TypeScript 吗?

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

@autoguru/icons 支持 ESM 还是 CommonJS?

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

@autoguru/icons 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.17.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@autoguru/icons 可以商用吗?

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

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

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

@autoguru/icons 还在维护吗?

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