@brightlayer-ui/icons-svg

中文文档
1.19.0发布于 2026/10/27BSD-3-ClauseCommonJS零依赖近 30 天下载 1.7万

SVG icons for Eaton applications

原始使用文档
文档目录7 节
  1. Installation
  2. Angular
  3. Usage
  4. Angular
  5. React
  6. React-Native
  7. Available SVG Icons

Brightlayer UI SVG Icons

Build

This is a library of SVG Icons for use in Brightlayer UI applications.

Installation

To install the Brightlayer UI SVG Icons from NPM as a dependency for your project, you can run one of the following commands in your project root:

npm install --save @brightlayer-ui/icons-svg
or
yarn add @brightlayer-ui/icons-svg

Angular

The method described below for Angular requires you to install the Angular CDK and Angular Material:

cd projectname
yarn add @angular/cdk @angular/material

and also include the following modules:

// app.module.ts
import {MatIconModule} from '@angular/material/icon';
import {HttpClientModule} from '@angular/common/http';
...
imports:[
  MatIconModule,
  HttpClientModule
]

Usage

Angular

The simplest way to use these SVGs in Angular is to register them with the matIconRegistry so they can be used with the <mat-icon> tag. You can register icons individually, or as the entire Brightlayer UI set:

import { Component } from "@angular/core";
import { MatIconRegistry } from "@angular/material/icon";
import { DomSanitizer } from "@angular/platform-browser";

declare var require: any;
const icon = require("@brightlayer-ui/icons-svg/breaker.svg").default; // individual icon
const iconSet = require("@brightlayer-ui/icons-svg/icons.svg").default; // full set

Then, in your constructor, register the icon or the icon set. It will then be available for use as a <mat-icon>.

Individual Icon

// app.component.ts
export class AppComponent {
  constructor(
    private matIconRegistry: MatIconRegistry,
    private domSanitizer: DomSanitizer
  ) {
    this.matIconRegistry.addSvgIcon(
      "breaker",
      this.domSanitizer.bypassSecurityTrustResourceUrl(icon)
    );
  }
}
// app.component.html
<mat-icon svgIcon="breaker"></mat-icon>

Entire Icon Set

// app.component.ts
export class AppComponent {
  constructor(
    private matIconRegistry: MatIconRegistry,
    private domSanitizer: DomSanitizer
  ) {
    this.matIconRegistry.addSvgIconSetInNamespace('blui-icons', this.domSanitizer.bypassSecurityTrustResourceUrl(iconSet));
  }
}
// app.component.ts
<mat-icon svgIcon="blui-icons:bearing"></mat-icon>

Applying Different Colors

To change the color of the icon you are using, simply set the CSS color property. This property is inheritable, so if the property is not set on your icon, it will be inherited from the parent container.

<mat-icon svgIcon="blui-icons:bearing" style="color: red"></mat-icon>

React

import icon from '@brightlayer-ui/icons-svg/ICON_NAME.svg';
...
<img src={icon}/>

NOTE: SVG icons used in this manner will appear black. The fill color cannot be changed because the SVGs are not inline. If you want to color the icons, you will want to use the @brightlayer-ui/icons-mui or our icon font.

NOTE: If you will be using many of these icons in your application, we recommend you use @brightlayer-ui/icons-mui or our icon font to simplify usage. This library makes more sense if you just need one or two icons or if you want to reduce the size of your bundle.

React-Native

React Native does not have built in support for SVG images. However, there are libraries available that will make them usable in your application. We recommend using react-native-svg-transformer in conjuction with react-native-svg. These will allow you to include Brightlayer UI SVG icons by importing and using them as normal components:

import Leaf from "@brightlayer-ui/icons-svg/leaf.svg";
...
<Leaf width={50} height={50} fill={'green'} />

Available SVG Icons

See the Iconography on brightlayer-ui.github.io for a list of currently available icons.

版本与发布记录

@brightlayer-ui/icons-svg 共发布 20 个版本,首次发布于 2021/10/28;过去 12 个月发布了 6 个版本。

版本发布日期距今
1.19.0latest2026/10/2712 天前
1.19.0-alpha.0alpha2026/09/181 个月前
1.18.02026/05/295 个月前
1.17.12026/04/286 个月前
1.17.02026/03/317 个月前
1.16.02025/11/2811 个月前

其他发布通道:beta → 1.7.0-beta.1,alpha → 1.19.0-alpha.0。

关于 @brightlayer-ui/icons-svg 的常见问题

@brightlayer-ui/icons-svg 是什么?

SVG icons for Eaton applications

如何安装 @brightlayer-ui/icons-svg?

在项目目录运行 npm install @brightlayer-ui/icons-svg,或使用 pnpm add / yarn add / bun add。

@brightlayer-ui/icons-svg 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/brightlayer-ui__icons-svg 是否存在。

@brightlayer-ui/icons-svg 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@brightlayer-ui/icons-svg 需要什么版本的 Node.js?

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

@brightlayer-ui/icons-svg 可以商用吗?

@brightlayer-ui/icons-svg 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

@brightlayer-ui/icons-svg 的下载量有多少?

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

@brightlayer-ui/icons-svg 还在维护吗?

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