@entur/icons

中文文档
10.1.1发布于 2026/11/02EUPL-1.2TypeScriptESM + CJS近 30 天下载 4.4万

This package contains the icon components.

原始使用文档
文档目录3 节
  1. Installation
  2. Usage
  3. Development

Icons

This package contains the icon components.

💡 Looking for the documentation?

Installation

npm install @entur/icons
# or if you are using Yarn:
yarn add @entur/icons

Usage

import { AddIcon } from '@entur/icons'; // Import specific icon

<AddIcon />;

Please refer to the documentation for usage information.

Development

This package contains all SVG files, as well as a script to create optimized React components from those SVG files.

If you're adding an icon, please add the SVG file to the appropriate svg/ folder. Make sure you give it a unique name, and make sure it looks correct in a browser after exporting it. Remember to add the icon-name in bin/build.js if it is a partner-icon.

If you're changing an existing icon, just update the existing SVG file with the new source code.

Unlike most other packages in our design system, this one doesn't use DTS-CLI or TypeScript. This is because DTS-CLI doesn't support the tools we need to optimize our SVG files. Instead, we've opted for configuring Rollup directly.

版本与发布记录

@entur/icons 共发布 203 个版本,首次发布于 2019/09/25;过去 12 个月发布了 30 个版本。

版本发布日期距今
10.1.1latest2026/11/0211 天前
10.1.02026/10/2915 天前
10.0.62026/09/181 个月前
10.0.52026/09/171 个月前
10.0.42026/09/082 个月前
10.0.32026/08/282 个月前

其他发布通道:next → 10.0.0-next.2。

关于 @entur/icons 的常见问题

@entur/icons 是什么?

This package contains the icon components.

如何安装 @entur/icons?

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

@entur/icons 支持 TypeScript 吗?

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

@entur/icons 支持 ESM 还是 CommonJS?

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

@entur/icons 可以商用吗?

@entur/icons 使用 EUPL-1.2 许可。声明的许可为 EUPL-1.2,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

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

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

@entur/icons 还在维护吗?

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