@aircall/react-icons

中文文档
0.8.3发布于 2026/08/18ISCTypeScriptES Module近 30 天下载 2868

Aircall Design icons distributed as SVG React components without styled-components dependency.

原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. Props
  4. Migration from @aircall/icons
  5. Development
  6. Icon Source
  7. Why this package?

@aircall/react-icons

Aircall Design icons distributed as SVG React components.

This package provides a modern, lightweight alternative to @aircall/icons without dependencies on styled-components or @xstyled.

Installation

pnpm add @aircall/react-icons

Usage

import { PlayFilled, PauseFilled } from '@aircall/react-icons';

// Basic usage
<PlayFilled />

// With size prop (sets both width and height)
<PlayFilled size={32} />
<PlayFilled size="2rem" />

// With individual dimensions
<PlayFilled width={24} height={24} />

// With color (inherits from CSS color)
<PlayFilled style={{ color: 'red' }} />
<PlayFilled className="text-primary" />

// With ref
const iconRef = useRef<SVGSVGElement>(null);
<PlayFilled ref={iconRef} />

// With other SVG props
<PlayFilled aria-label="Play" role="img" />

Props

PropTypeDefaultDescription
sizenumber | string'24px'Sets both width and height
widthnumber | string'24px'Width of the icon (overridden by size)
heightnumber | string'24px'Height of the icon (overridden by size)
refRef<SVGSVGElement>-React ref forwarded to the SVG element
...propsSVGProps<SVGSVGElement>-Any valid SVG props

Migration from @aircall/icons

Replace imports from @aircall/icons with @aircall/react-icons:

- import { PlayFilled } from '@aircall/icons';
+ import { PlayFilled } from '@aircall/react-icons';

The API is similar but without styled-components styling props. Use the size prop or standard CSS for styling.

Development

Generate icons from SVGs:

pnpm --filter=@aircall/react-icons run generate:icons

Build the package:

pnpm --filter=@aircall/react-icons run build:package

Icon Source

Icons are sourced from the Figma design file: Icons v2

SVG files should be placed in src/svgs/ directory and follow the naming convention:

  • Use PascalCase with hyphens (e.g., Play-Filled.svg, Chevron-Down-Outlined.svg)
  • SVGR will convert these to component names (e.g., PlayFilled, ChevronDownOutlined)

Why this package?

This package was created to provide a modern, lightweight alternative to @aircall/icons that:

  1. No CSS-in-JS dependencies - Removes the requirement for styled-components and @xstyled
  2. Smaller bundle size - Icons are pure SVG components with minimal wrapper code
  3. Better tree-shaking - Each icon is a separate file that can be individually imported
  4. Modern React patterns - Uses React.forwardRef for proper ref forwarding
  5. TypeScript support - Full TypeScript definitions for props and component types

版本与发布记录

@aircall/react-icons 共发布 11 个版本,首次发布于 2026/01/10;过去 12 个月发布了 11 个版本。

版本发布日期距今
0.8.3latest2026/08/182 个月前
0.8.12026/08/172 个月前
0.8.02026/08/112 个月前
0.7.02026/07/283 个月前
0.6.02026/07/014 个月前
0.5.02026/06/274 个月前

关于 @aircall/react-icons 的常见问题

@aircall/react-icons 是什么?

Aircall Design icons distributed as SVG React components without styled-components dependency.

如何安装 @aircall/react-icons?

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

@aircall/react-icons 支持 TypeScript 吗?

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

@aircall/react-icons 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aircall/react-icons 可以商用吗?

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

@aircall/react-icons 的下载量有多少?

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

@aircall/react-icons 还在维护吗?

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