@amsterdam/design-system-react-icons

中文文档
2.3.0发布于 2026/10/22SEE LICENSE IN LICENSE.mdTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 1.4万

All icons from the Amsterdam Design System as React components. Use it to use the correct icons in your React project.

原始使用文档
文档目录5 节
  1. Installation
  2. Usage
  3. Right-to-left mirroring
  4. Updating
  5. Support

Amsterdam Design System: React icons

This package provides all icons from the Amsterdam Design System as React components. Use it to use the correct icons in your React project.

Installation

Install this package by itself if you want or need to use icons directly in your React project.

Note that our React components contain an Icon component that offers a convenient API for using the icons and streamlines alignment with text.

npm install @amsterdam/design-system-react-icons

Usage

Import the component for the icon you need, as well as the generic Icon component, and use them in your JSX.

import { Icon } from "@amsterdam/design-system-react"
import { SearchIcon } from "@amsterdam/design-system-react-icons"

export const App = () => <Icon svg={SearchIcon} />

Right-to-left mirroring

Some icons (arrows, vehicles, speech balloons, and similar) carry a data-directional="true" attribute on their root <svg> element and are meant to be horizontally mirrored in a right-to-left (RTL) context. When you render an icon through the Icon component, this mirroring is handled automatically by @amsterdam/design-system-css's .ams-icon styles.

If you render an icon component directly, without wrapping it in Icon, you are responsible for the mirroring yourself. Add a rule along these lines, scoped to wherever you render the icon:

.your-icon-wrapper:dir(rtl) svg[data-directional="true"] {
  transform: scaleX(-1);
}

Apply :dir(rtl) to the wrapper, not the <svg> itself. Directionality determination is defined per document language, and SVG has its own rules distinct from HTML's — applying :dir() directly to an <svg> element relies on unspecified cross-namespace inheritance behaviour that browsers handle inconsistently.

See the icon contribution guide for which icons carry the attribute and why.

Updating

When updating to a new release of this package, check the change log for breaking changes. If there are any, update your application accordingly.

Support

Contact us if you have a question, find an issue, or want to contribute. Find ways to reach us on designsystem.amsterdam.

版本与发布记录

@amsterdam/design-system-react-icons 共发布 23 个版本,首次发布于 2023/02/10;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.3.0latest2026/10/2216 天前
2.2.02026/07/133 个月前
2.1.02026/06/244 个月前
2.0.02026/01/099 个月前
1.1.12025/10/311 年前
1.1.02025/09/261.1 年前

关于 @amsterdam/design-system-react-icons 的常见问题

@amsterdam/design-system-react-icons 是什么?

All icons from the Amsterdam Design System as React components. Use it to use the correct icons in your React project.

如何安装 @amsterdam/design-system-react-icons?

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

@amsterdam/design-system-react-icons 支持 TypeScript 吗?

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

@amsterdam/design-system-react-icons 支持 ESM 还是 CommonJS?

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

@amsterdam/design-system-react-icons 可以商用吗?

@amsterdam/design-system-react-icons 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@amsterdam/design-system-react-icons 的下载量有多少?

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

@amsterdam/design-system-react-icons 还在维护吗?

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