@agentscope-ai/icons-svg-override-antd

中文文档
4.4.2发布于 2025/06/25MITTypeScriptESM + CJS零依赖近 30 天下载 5635

基于蚂蚁设计图标的火花设计图标的抽象节点

中文使用文档
文档目录3 节
  1. 安装
  2. 开始吧
  3. 助推器

蚂蚁设计图标

基于Ant设计图标的Spark Design SVG图标的抽象节点.

安装

# use yarn
$ yarn add @agentscope-ai/icons-svg-override-antd

# or use npm
$ npm install @agentscope-ai/icons-svg-override-antd --save

开始吧

import { AccountBookOutlined } from '@agentscope-ai/icons-svg-override-antd';

console.log(AccountBookOutlined);
// ==>
// {
//   name: 'account-book',
//   theme: 'outlined',
//   icon: {
//     tag: 'svg',
//     attrs: {
//       viewBox: '64 64 896 896',
//       focusable: 'false'
//     },
//     children: [
//       {
//         tag: 'path',
//         attrs: {
//           d:
//             'M880 184H712v-64c0-4.4-3.6-8-8-8h- ...'
//         }
//       }
//     ]
//   }
// };
  • 接口

此库将全部 SVG 文件导出为 IconDefinition。 。 。 .

// types.d.ts
export declare type ThemeType = 'filled' | 'outlined' | 'twotone';

export interface AbstractNode {
  tag: string;
  attrs: {
    [key: string]: string;
  };
  children?: AbstractNode[];
}

export interface IconDefinition {
  name: string; // kebab-case-style
  theme: ThemeType;
  icon:
    | ((primaryColor: string, secondaryColor: string) => AbstractNode)
    | AbstractNode;
}

助推器

import { AccountBookFilled } from '@agentscope-ai/icons-svg-override-antd';
import { renderIconDefinitionToSVGElement } from '@agentscope-ai/icons-svg-override-antd/es/helpers';

const svgHTMLString = renderIconDefinitionToSVGElement(AccountBookFilled, {
  extraSVGAttrs: { width: '1em', height: '1em', fill: 'currentColor' }
});

console.log(svgHTMLString);
// ==>
// '<svg viewBox="64 64 896 896" width="1em" height="1em" fill="currentColor"><path d="M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648.3 426.8l-87.7 161.1h45.7c5.5 0 10 4.5 10 10v21.3c0 5.5-4.5 10-10 10h-63.4v29.7h63.4c5.5 0 10 4.5 10 10v21.3c0 5.5-4.5 10-10 10h-63.4V752c0 5.5-4.5 10-10 10h-41.3c-5.5 0-10-4.5-10-10v-51.8h-63.1c-5.5 0-10-4.5-10-10v-21.3c0-5.5 4.5-10 10-10h63.1v-29.7h-63.1c-5.5 0-10-4.5-10-10v-21.3c0-5.5 4.5-10 10-10h45.2l-88-161.1c-2.6-4.8-.9-10.9 4-13.6 1.5-.8 3.1-1.2 4.8-1.2h46c3.8 0 7.2 2.1 8.9 5.5l72.9 144.3 73.2-144.3a10 10 0 0 1 8.9-5.5h45c5.5 0 10 4.5 10 10 .1 1.7-.3 3.3-1.1 4.8z" /></svg>'
  • 接口
declare function renderIconDefinitionToSVGElement(
  icon: IconDefinition,
  options?: HelperRenderOptions
): string;

interface HelperRenderOptions {
  placeholders?: {
    primaryColor?: string; // default #333
    secondaryColor?: string; // default #E6E6E6
  };
  extraSVGAttrs?: {
    [key: string]: string;
  };
}

版本与发布记录

@agentscope-ai/icons-svg-override-antd 共发布 1 个版本,首次发布于 2025/06/25;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.4.2latest2025/06/251.4 年前

关于 @agentscope-ai/icons-svg-override-antd 的常见问题

@agentscope-ai/icons-svg-override-antd 是什么?

基于蚂蚁设计图标的火花设计图标的抽象节点

如何安装 @agentscope-ai/icons-svg-override-antd?

在项目目录运行 npm install @agentscope-ai/icons-svg-override-antd,或使用 pnpm add / yarn add / bun add。

@agentscope-ai/icons-svg-override-antd 支持 TypeScript 吗?

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

@agentscope-ai/icons-svg-override-antd 支持 ESM 还是 CommonJS?

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

@agentscope-ai/icons-svg-override-antd 可以商用吗?

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

@agentscope-ai/icons-svg-override-antd 的下载量有多少?

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

@agentscope-ai/icons-svg-override-antd 还在维护吗?

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