Installations
npm install @ant-design/icons-angular
Developer Guide
Typescript
No
Module System
ESM
Node Version
20.11.1
NPM Version
10.2.4
Score
96.1
Supply Chain
97.2
Quality
84
Maintenance
100
Vulnerability
98.9
License
Releases
Unable to fetch releases
Contributors
Languages
TypeScript (99.03%)
JavaScript (0.84%)
Less (0.06%)
HTML (0.04%)
Shell (0.02%)
CSS (0.01%)
EJS (0.01%)
Developer
Download Statistics
Total Downloads
13,891,312
Last Day
15,342
Last Week
63,428
Last Month
288,049
Last Year
3,630,636
GitHub Statistics
974 Stars
678 Commits
587 Forks
41 Watching
14 Branches
79 Contributors
Bundle Size
45.03 kB
Minified
15.10 kB
Minified + Gzipped
Package Meta Information
Latest Version
19.0.0
Package Id
@ant-design/icons-angular@19.0.0
Unpacked Size
3.00 MB
Size
699.43 kB
File Count
2,516
NPM Version
10.2.4
Node Version
20.11.1
Publised On
25 Nov 2024
Total Downloads
Cumulative downloads
Total Downloads
13,891,312
Last day
0.3%
15,342
Compared to previous day
Last week
-18.1%
63,428
Compared to previous week
Last month
2%
288,049
Compared to previous month
Last year
17%
3,630,636
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Peer Dependencies
4
Ant Design Icons for Angular
Installation
1ng add @ant-design/icons-angular 2 3# or npm install @ant-design/icons-angular
Usage
You should import IconDirective
in your component.
1import { IconDirective } from '@ant-design/icons-angular'; 2 3@Component({ 4 imports: [ IconDirective ] 5}) 6export class AppComponent {}
And register the icons that you need to IconService
(all or explicitly, we call it static loading):
ATTENTION! We strongly suggest you not to register all icons. That would increase your bundle's size dramatically.
1import { Component } from '@angular/core'; 2import { IconService } from '@ant-design/icons-angular'; 3import { AccountBookFill } from '@ant-design/icons-angular/icons' 4// import * as AllIcons from 'ant-icons-angular/icons'; 5 6@Component({ 7 // ... 8}) 9export class AppComponent { 10 constructor(private _iconService: IconService) { 11 // Import all. NOT RECOMMENDED. ❌ 12 // const antDesignIcons = AllIcons as { 13 // [key: string]: IconDefinition; 14 // }; 15 // this._iconService.addIcon(...Object.keys(antDesignIcons).map(key => antDesignIcons[key])); 16 17 // Import what you need! ✔️ 18 this._iconService.addIcon(...[ AccountBookFill ]); 19 this._iconService.twoToneColor = { primaryColor: '#1890ff' }; 20 } 21}
You can also provide icons you need in the app.config.ts
:
1import { ApplicationConfig } from '@angular/core'; 2import { provideAntIcons } from '@ant-design/icons-angular'; 3import { AccountBookFill } from '@ant-design/icons-angular/icons'; 4 5export const appConfig: ApplicationConfig = { 6 providers: [ 7 provideAntIcons([ AccountBookFill ]) 8 ] 9};
When you want to render an icon:
1<span antIcon type="ant-cloud" theme="outline"></span>
Checkout the demo for more details.
For icons provided by Ant Design, we provide dynamic loading strategy to reduce bundle's size. Just config your angular.json
and you even don't need to register the icons! Checkout our examples
dir and angular.json
file for more details.
Namespace
Namespace is first introduced in 2.0.0-beta.2
. It allows users to register their own icons with simple API, support both dynamic loading and static loading.
Say you want to add a panda
icon in animal
namespace. For static loading, you should call addIconLiteral('animal:panda', '<svg>...</svg>')
. For dynamic loading, just put panda.svg
under assets/animal
. And render a panda like: <span antIcon type="animal:panda">
.
Please checkout the demo for more details.
Development
You can find the source code here.
Setup
Install dependencies of @ant-design/icons-angular
, and run npm run generate
.
Demo
Run npm run generate
and then npm run start
.
Build
Run npm run build:lib
.
Extension
You can simply extend this package by creating directives or services that extends IconDirective
and IconService
. And it is worth mentioning that _changeIcon
method returns a Promise<svg>
using which you could add extra modifications.
ng-zorro-antd is a good example of extending this package.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 16/30 approved changesets -- score normalized to 5
Reason
6 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/rebase.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rebase.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/ant-design/ant-design-icons/rebase.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/rebase.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/ant-design/ant-design-icons/rebase.yml/master?enable=pin
- Info: 0 out of 1 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 22 are checked with a SAST tool
Score
4.4
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More