fa-icon-element

1.0.1 • Public • Published

fa-icon Custom Element

npm version

FontAwesome Version: v4.7.0

Vanilla custom element that displays FontAwesome icons in your page.


Installation

To install, run:

npm i fa-icon-element

Then, either import the file directly with:

<script src="path/to/node_modules/fa-icon-element/src/fa-icon.js" defer></script>

or, include it in your webpack (or similar) build:

import "fa-icon-element";

Usage

Once installed, simply use with:

<fa-icon name="fa-plus"></fa-icon>

Where the name attribute is any valid FontAwesome icon name. See here for a list of icons.

Known Issues, Potential Gotchas

  • The FontAwesome font face is loaded from the FontAwesome CDN. It is currently not possible to load a local instance of the FontAwesome set. Please open an issue if you need this feature.
  • Due to a potential bug, the @font-face for FontAwesome is elevated to the global CSS scope. See this article by Rob Dodson for more information.

Legal

Font Awesome by Dave Gandy - fontawesome.io (License Info)

Package Sidebar

Install

npm i fa-icon-element

Weekly Downloads

2

Version

1.0.1

License

ISC

Last publish

Collaborators

  • imattie