ng2_fontawesome 4.7.0+4

  • Installing
  • Versions
  • 0

Font Awesome for Angular2Dart #

View Demo

Basic Usage #

This package provides Font Awesome as an Angular2Dart component, making it easy to add icons to your Angular2Dart project. Add directives: const [FontAwesomeIconComponent] to your parent component, and then you can use the element in your markup:

<fa name="flag"></fa>

This Dart package implements all of the Font Awesome effects seen here.

Versioning #

The version number of this package follows the version number of Font Awesome itself. This makes it easy to see which version of Font Awesome is provided by this package and pin your own packages to specific versions of Font Awesome (i.e. a version that adds a specific glyph that your package needs).

Icons #

Font Awesome icons are implemented in FontAwesomeIconComponent. It requires one name attribute, which is the name of the icon to render:

<fa name="flag"></fa>

The component also supports all of the other Font Awesome effects through the following attributes:

  • border (bool): Display a border.
  • flip (String): Flip the icon over its "horizontal" or "vertical" axis.
  • fw (bool): Render as fixed width element.
  • inverse (bool): Invert the color scheme.
  • pull (String): Float to the "left" or "right".
  • pulse (bool): Animate a rotating icon in 8 discrete steps.
  • rotate (int): Rotate 90, 180, or 270 degrees.
  • size (String): Icon size. "lg" is 33% larger than normal, or use "2x", "3x", "4x", or "5x".
  • spin (bool): Animate the icon spinning continuously.
  • stack (bool): Indicates that the icon is part of a stack a stack, i.e. <fa-stack>, and sets the size to either "1x" or "2x".

Bulleted List #

Font Awesome icons can be used as bullets. Add FontAwesomeListComponent and FontAwesomeListItemComponent to your directives, then write markup like this:

  <fa-li bullet="flag">Item one</fa-li>
  <fa-li bullet="spinner">Item two</fa-li>
  <fa-li bullet="check-square">Item three</fa-li>

The only new attribute is bullet, which should contain the name of the icon to use as the list item's bullet. You may also supply a default bullet that is used for list items which do not specify a bullet:

<fa-ul bullet='check-square'>
  <fa-li>Item one</fa-li>
  <fa-li>Item two</fa-li>
  <fa-li>Item three</fa-li>

Icon Stack #

Font Awesome also lets you stack icons on top of each other. Add FontAwesomeStackComponent to your directives, then write markup like this:

  <fa name="circle" stack="2x"></fa>
  <fa name="flag" stack="1x" [inverse]="true"></fa>

An icon stack consists of two icons inside an <fa-stack>. The stack attribute is required in this context and sets the icon's size, either "1x" or "2x" .

Maintenance #

This section is for the developer[s] of this package only.

To upgrade Font Awesome, download and unzip the upstream release. Replace lib/css and lib/fonts in this package with the css and fonts from the upstream release. The modify the font-awesome-css and font-awesome.css.min as follows:

sed --in-place "s:url[(]'\.\.:url('packages:g" lib/css/*

Commit the changed files, update the version in pubspec.yaml to match the upstream Font Awesome version, and publish with pub publish.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  ng2_fontawesome: ^4.7.0+4

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:ng2_fontawesome/ng2_fontawesome.dart';
Version Uploaded Documentation Archive
4.7.0+4 Jan 12, 2017 Go to the documentation of ng2_fontawesome 4.7.0+4 Download ng2_fontawesome 4.7.0+4 archive
4.7.0+3 Dec 9, 2016 Go to the documentation of ng2_fontawesome 4.7.0+3 Download ng2_fontawesome 4.7.0+3 archive
4.7.0+2 Dec 9, 2016 Go to the documentation of ng2_fontawesome 4.7.0+2 Download ng2_fontawesome 4.7.0+2 archive
4.7.0+1 Dec 9, 2016 Go to the documentation of ng2_fontawesome 4.7.0+1 Download ng2_fontawesome 4.7.0+1 archive
4.7.0 Dec 9, 2016 Go to the documentation of ng2_fontawesome 4.7.0 Download ng2_fontawesome 4.7.0 archive
0.0.1 Dec 8, 2016 Go to the documentation of ng2_fontawesome 0.0.1 Download ng2_fontawesome 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.12.0 <2.0.0