fa-icon-element
v1.0.1
Published
Vanilla custom element that displays FontAwesome icons
Downloads
9
Maintainers
Readme
fa-icon Custom Element
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)