1 | <a href="https://fontawesome.com">
|
2 | <img align="right" width="100" height="100" alt="Official Javascript Component" src="https://img.fortawesome.com/349cfdf6/official-javascript-component.svg">
|
3 | </a>
|
4 |
|
5 | # angular-fontawesome
|
6 |
|
7 | [](https://www.npmjs.com/package/@fortawesome/angular-fontawesome)
|
8 |
|
9 | Official Angular component for Font Awesome 5+
|
10 |
|
11 | ## Installation
|
12 |
|
13 | If you have [FontAwesome Pro](https://fontawesome.com/plans) subscription, make sure to [configure access](https://fontawesome.com/docs/web/setup/packages#_1-configure-access) before following the installation instructions.
|
14 |
|
15 | Using `ng add`:
|
16 |
|
17 | ```
|
18 | # See Compatibility table below to choose a correct version
|
19 | $ ng add @fortawesome/angular-fontawesome@<version>
|
20 | ```
|
21 |
|
22 | Using [Yarn](https://yarnpkg.com)
|
23 | ```
|
24 | $ yarn add @fortawesome/free-solid-svg-icons
|
25 | # See Compatibility table below to choose a correct version
|
26 | $ yarn add @fortawesome/angular-fontawesome@<version>
|
27 | ```
|
28 |
|
29 | Using [NPM](https://www.npmjs.com/)
|
30 | ```
|
31 | $ npm install @fortawesome/free-solid-svg-icons
|
32 | # See Compatibility table below to choose a correct version
|
33 | $ npm install @fortawesome/angular-fontawesome@<version>
|
34 | ```
|
35 |
|
36 | ### Compatibility table
|
37 |
|
38 | | @fortawesome/angular-fontawesome | Angular | Font Awesome | ng-add |
|
39 | |----------------------------------|------------|--------------|---------------|
|
40 | | 0.1.x | 5.x | 5.x | not supported |
|
41 | | 0.2.x | 6.x | 5.x | not supported |
|
42 | | 0.3.x | 6.x && 7.x | 5.x | not supported |
|
43 | | 0.4.x, 0.5.x | 8.x | 5.x | not supported |
|
44 | | 0.6.x | 9.x | 5.x | supported |
|
45 | | 0.7.x | 10.x | 5.x | supported |
|
46 | | 0.8.x | 11.x | 5.x | supported |
|
47 | | 0.9.x | 12.x | 5.x | supported |
|
48 | | 0.10.x | 13.x | 5.x && 6.x | supported |
|
49 | | 0.11.x | 14.x | 5.x && 6.x | supported |
|
50 | | 0.12.x | 15.x | 5.x && 6.x | supported |
|
51 | | 0.13.x | 16.x | 5.x && 6.x | supported |
|
52 | | 0.14.x | 17.x | 5.x && 6.x | supported |
|
53 | | 0.15.x | 18.x | 5.x && 6.x | supported |
|
54 | | 1.x | 19.x | 5.x && 6.x | supported |
|
55 |
|
56 | ## Usage
|
57 |
|
58 | To get up and running using Font Awesome with Angular follow the below steps:
|
59 |
|
60 | 1. Add `FontAwesomeModule` to the `imports` and tie the icon to the property in your component
|
61 | `src/app/app.component.ts`:
|
62 |
|
63 | ```typescript
|
64 | import { Component } from '@angular/core';
|
65 | import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
66 | import { faCoffee } from '@fortawesome/free-solid-svg-icons';
|
67 |
|
68 | @Component({
|
69 | selector: 'app-root',
|
70 | imports: [FontAwesomeModule], // alternatively, individual components can be imported
|
71 | templateUrl: './app.component.html'
|
72 | })
|
73 | export class AppComponent {
|
74 | faCoffee = faCoffee;
|
75 | }
|
76 | ```
|
77 |
|
78 | 1. Use the icon in the template
|
79 | `src/app/app.component.html`:
|
80 |
|
81 | ```html
|
82 | <fa-icon [icon]="faCoffee"></fa-icon>
|
83 | ```
|
84 |
|
85 | ## Documentation
|
86 |
|
87 | * [In-depth usage guide](./docs/usage.md)
|
88 | * [Using other styles](./docs/usage/using-other-styles.md)
|
89 | * [Full feature list](./docs/usage/features.md)
|
90 | * [Upgrading instructions](UPGRADING.md)
|
91 | * [Frequency asked questions](./docs/faq.md)
|
92 |
|
93 | ## Examples
|
94 |
|
95 | ### Stackblitz
|
96 | Here's a [StackBlitz Starter Sample](https://stackblitz.com/edit/angular-ivy-7jrcne) on how to display Solid, Regular, and Brand icons [using the Icon Library](./docs/usage/icon-library.md#using-the-icon-library).
|
97 |
|
98 |
|
99 | ### Demo application
|
100 | You can find examples in the `projects/demo` directory. You can follow [the docs to run the demo app](./DEVELOPER.md#setting-up-the-local-environment) on your own machine.
|
101 |
|
102 | ## Contributing
|
103 | `angular-fontawesome` is a product of the community, you can take a look at the [developer docs](./DEVELOPER.md) to find about more on how to contribute back to the project.
|
104 |
|
105 | ## Contributors
|
106 |
|
107 | The following contributors have either helped to start this project, have contributed
|
108 | code, are actively maintaining it (including documentation), or in other ways
|
109 | being awesome contributors to this project. **We'd like to take a moment to recognize them.**
|
110 |
|
111 | [<img src="https://github.com/devoto13.png?size=72" alt="devoto13" width="72">](https://github.com/devoto13)
|
112 | [<img src="https://github.com/zeevkatz.png?size=72" alt="zeevkatz" width="72">](https://github.com/zeevkatz)
|
113 | [<img src="https://github.com/scttcper.png?size=72" alt="scttcper" width="72">](https://github.com/scttcper)
|
114 | [<img src="https://github.com/DavidePastore.png?size=72" alt="DavidePastore" width="72">](https://github.com/DavidePastore)
|
115 | [<img src="https://github.com/donmckenna.png?size=72" alt="donmckenna" width="72">](https://github.com/donmckenna)
|
116 | [<img src="https://github.com/paustint.png?size=72" alt="paustint" width="72">](https://github.com/paustint)
|
117 | [<img src="https://github.com/mzellho.png?size=72" alt="mzellho" width="72">](https://github.com/mzellho)
|
118 | [<img src="https://github.com/elebitzero.png?size=72" alt="elebitzero" width="72">](https://github.com/elebitzero)
|
119 | [<img src="https://github.com/mcenkar.png?size=72" alt="mcenkar" width="72">](https://github.com/mcenkar)
|
120 | [<img src="https://github.com/SiddAjmera.png?size=72" alt="SiddAjmera" width="72">](https://github.com/SiddAjmera)
|
121 | [<img src="https://github.com/stephaniepurvis.png?size=72" alt="stephaniepurvis" width="72">](https://github.com/stephaniepurvis)
|
122 | [<img src="https://github.com/loicgasser.png?size=72" alt="loicgasser" width="72">](https://github.com/loicgasser)
|
123 | [<img src="https://github.com/damienwebdev.png?size=72" alt="damienwebdev" width="72">](https://github.com/damienwebdev)
|
124 | [<img src="https://github.com/ronniebarker.png?size=72" alt="ronniebarker" width="72">](https://github.com/ronniebarker)
|
125 | [<img src="https://github.com/bhanuhiteshi.png?size=72" alt="bhanuhiteshi" width="72">](https://github.com/bhanuhiteshi)
|
126 | [<img src="https://github.com/MrSuttonmann.png?size=72" alt="MrSuttonmann" width="72">](https://github.com/MrSuttonmann)
|
127 | [<img src="https://github.com/ej2.png?size=72" alt="ej2" width="72">](https://github.com/ej2)
|
128 | [<img src="https://github.com/peterblazejewicz.png?size=72" alt="peterblazejewicz" width="72">](https://github.com/peterblazejewicz)
|
129 | [<img src="https://github.com/arjenbrandenburgh.png?size=72" alt="arjenbrandenburgh" width="72">](https://github.com/arjenbrandenburgh)
|
130 | [<img src="https://github.com/athisun.png?size=72" alt="athisun" width="72">](https://github.com/athisun)
|
131 | [<img src="https://github.com/madebyjeffrey.png?size=72" alt="madebyjeffrey" width="72">](https://github.com/madebyjeffrey)
|
132 | [<img src="https://github.com/benjamincharity.png?size=72" alt="benjamincharity" width="72">](https://github.com/benjamincharity)
|
133 | [<img src="https://github.com/NayeBeckham.png?size=72" alt="NayeBeckham" width="72">](https://github.com/NayeBeckham)
|
134 | [<img src="https://github.com/Nosfistis.png?size=72" alt="Nosfistis" width="72">](https://github.com/Nosfistis)
|
135 | [<img src="https://github.com/bleistift-zwei.png?size=72" alt="bleistift-zwei" width="72">](https://github.com/bleistift-zwei)
|
136 | [<img src="https://github.com/igorls.png?size=72" alt="igorls" width="72">](https://github.com/igorls)
|
137 | [<img src="https://github.com/jasonlundien.png?size=72" alt="jasonlundien" width="72">](https://github.com/jasonlundien)
|
138 | [<img src="https://github.com/FortAwesome.png?size=72" alt="Font Awesome Team" width="72">](https://github.com/orgs/FortAwesome/people)
|
139 |
|
140 | If we've missed someone (which is quite likely) submit a Pull Request to us and we'll get it resolved.
|