npm install @fortawesome/angular-fontawesome

Angular Fontawesome, an Angular library

About @fortawesome/angular-fontawesome

The npm package @fortawesome/angular-fontawesome is a comprehensive library designed to integrate FontAwesome icons directly into Angular applications. This module is essential for developers looking to enhance their UI/UX with high-quality icons that are scalable and customizable. FontAwesome provides a vast array of icons that cover various use cases, from social media icons to user interface directional indicators. By leveraging this package, developers can ensure that their applications are visually appealing and functionally rich, offering a better user experience. The icons are optimized for performance and are accessible, making them a smart choice for projects that prioritize inclusivity and user engagement.

To incorporate FontAwesome icons into an Angular project, developers can use the command npm install @fortawesome/angular-fontawesome. This command simplifies the process of adding FontAwesome to an Angular application, allowing developers to easily include and manage icons throughout their project. Once installed, developers can use Angular's component-based architecture to bind icons directly in their templates, providing a seamless integration. The package also supports server-side rendering with Angular Universal, ensuring that icons render correctly in SEO-friendly server-generated content.

The @fortawesome/angular-fontawesome module supports tree-shaking, ensuring that only the icons used in the application are included in the final bundle, thus optimizing the application's load time and overall performance. Additionally, the package allows for easy customization of icons, enabling developers to adjust size, color, and shadows to match the design specifications of any project. This level of customization and optimization makes @fortawesome/angular-fontawesome a powerful tool for developers looking to create modern, robust, and aesthetically pleasing web applications using Angular.

More from FortAwesome

FortAwesome npm packages

Find the best node modules for your project.

Search npm

@fortawesome/angular-fontawesome

Angular Fontawesome, an Angular...

Read more

Dependencies

Core dependencies of this npm package and its dev dependencies.

tslib, @angular-devkit/build-angular, @angular-devkit/core, @angular-devkit/schematics, @angular-eslint/builder, @angular-eslint/eslint-plugin, @angular-eslint/eslint-plugin-template, @angular-eslint/schematics, @angular-eslint/template-parser, @angular/animations, @angular/cli, @angular/common, @angular/compiler, @angular/compiler-cli, @angular/core, @angular/language-service, @angular/platform-browser, @angular/platform-browser-dynamic, @angular/platform-server, @angular/router, @angular/ssr, @fortawesome/fontawesome-svg-core, @fortawesome/free-regular-svg-icons, @fortawesome/free-solid-svg-icons, @types/express, @types/jasmine, @types/node, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, browser-sync, chromedriver, eslint, eslint-config-prettier, eslint-plugin-import, eslint-plugin-jsdoc, eslint-plugin-prefer-arrow, express, jasmine-core, jasmine-spec-reporter, karma, karma-chrome-launcher, karma-coverage, karma-jasmine, karma-jasmine-html-reporter, ng-packagr, prettier, protractor, rxjs, ts-node, typescript, zone.js

Documentation

A README file for the @fortawesome/angular-fontawesome code repository. View Code

Official Javascript Component

angular-fontawesome

npm

Official Angular component for Font Awesome 5+

Installation

If you have FontAwesome Pro subscription, make sure to configure access before following the installation instructions.

Using ng add:

# See Compatibility table below to choose a correct version
$ ng add @fortawesome/angular-fontawesome@<version>

Using Yarn

$ yarn add @fortawesome/fontawesome-svg-core
$ 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/fontawesome-svg-core
$ 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 ng-add
0.1.x 5.x 5.x not supported
0.2.x 6.x 5.x not supported
0.3.x 6.x && 7.x 5.x not supported
0.4.x, 0.5.x 8.x 5.x not supported
0.6.x 9.x 5.x supported
0.7.x 10.x 5.x supported
0.8.x 11.x 5.x supported
0.9.x 12.x 5.x supported
0.10.x 13.x 5.x && 6.x supported
0.11.x 14.x 5.x && 6.x supported
0.12.x 15.x 5.x && 6.x supported
0.13.x 16.x 5.x && 6.x supported
0.14.x 17.x 5.x && 6.x supported

Usage

To get up and running using Font Awesome with Angular follow the below steps:

  1. Add FontAwesomeModule to the imports and tie the icon to the property in your component src/app/app.component.ts:

    import { Component } from '@angular/core';
    import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
    import { faCoffee } from '@fortawesome/free-solid-svg-icons';
    
    @Component({
      selector: 'app-root',
      standalone: true,
      imports: [FontAwesomeModule], // alternatively, individual components can be imported
      templateUrl: './app.component.html'
    })
    export class AppComponent {
      faCoffee = faCoffee;
    }
    
  2. Use the icon in the template src/app/app.component.html:

    <fa-icon [icon]="faCoffee"></fa-icon>
    

Documentation

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.

devoto13 zeevkatz scttcper DavidePastore donmckenna paustint mzellho elebitzero mcenkar SiddAjmera stephaniepurvis loicgasser damienwebdev ronniebarker bhanuhiteshi MrSuttonmann ej2 peterblazejewicz arjenbrandenburgh athisun madebyjeffrey benjamincharity NayeBeckham Nosfistis Font Awesome Team

If we've missed someone (which is quite likely) submit a Pull Request to us and we'll get it resolved.