FortAwesome/angular-fontawesome
关于
Font Awesome 5 及更高版本的官方 Angular 组件
学习资源实测星标增长
- 24小时
- +1
- 7天
- +1
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文angular-fontawesome
Official Angular component for Font Awesome 5+
Installation
If you have FontAwesome Pro subscription, make sure to configure access before following the installation instructions.
Note: Pro+ Icons are only available in Kit Packages Along with a Pro+ Plan, you'll need to install a downloaded Kit package to use any of our Pro+ Icons — they are not available in any other packages. Read more.
Using ng add:
# See Compatibility table below to choose a correct version
$ ng add @fortawesome/angular-fontawesome@<version>
Using Yarn
$ yarn add @fortawesome/free-solid-svg-icons
# See Compatibility table below to choose a correct version
$ yarn add @fortawesome/angular-fontawesome@<version>
Using NPM
$ npm install @fortawesome/free-solid-svg-icons
# See Compatibility table below to choose a correct version
$ npm install @fortawesome/angular-fontawesome@<version>
Compatibility table
| @fortawesome/angular-fontawesome | Angular | Font Awesome |
|---|---|---|
| 5.x | 22.x | 5.x && 6.x && 7.x |
| 4.x | 21.x | 5.x && 6.x && 7.x |
| 3.x | 20.x | 5.x && 6.x && 7.x |
See the compatibility page for older versions.
Usage
To get up and running using Font Awesome with Angular follow the below steps:
Add
FontAwesomeModuleto theimportsand tie the icon to the property in your componentsrc/app/app.component.ts:import { Component } from '@angular/core'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { faCoffee } from '@fortawesome/free-solid-svg-icons'; // Import from Kit Packages (Pro+ Icons) // import {faCloud} from "@awesome.me/kit-<KIT_ID>/icons/slab/regular"; @Component({ selector: 'app-root', imports: [FontAwesomeModule], // alternatively, individual components can be imported templateUrl: './app.component.html' }) export class AppComponent { faCoffee = faCoffee; }Use the icon in the template
src/app/app.component.html:<fa-icon [icon]="faCoffee" />
Documentation
- In-depth usage guide
- Using other styles
- Full feature list
- Upgrading instructions
- Frequency asked questions
Examples
Stackblitz
Here's a StackBlitz Starter Sample on how to display Solid, Regular, and Brand icons using the Icon Library.
Demo application
You can find examples in the projects/demo directory. You can follow the docs to run the demo app on your own machine.
Contributing
angular-fontawesome is a product of the community, you can take a look at the developer docs to find about more on how to contribute back to the project.
Contributors
The following contributors have either helped to start this project, have contributed code, are actively maintaining it (including documentation), or in other ways being awesome contributors to this project. We'd like to take a moment to recognize them.
If we've missed someone (which is quite likely) submit a Pull Request to us and we'll get it resolved.
探索相关项目
加载中…

































