Non-official webcomponents for
Font Awesome
.
The API and usage is based on vue-fontawesome.
# Install peer dependency
$ npm i --save @fortawesome/fontawesome-svg-core
# Install the components
$ npm i --save @riovir/wc-fontawesome
# Install a Font Awesome format icon pack
$ npm i --save @fortawesome/free-solid-svg-icons
import { FontAwesomeIcon } from '@riovir/wc-fontawesome'
customElements.define('font-awesome-icon', FontAwesomeIcon);
// Alternatively, use a shorter name
customElements.define('fa-icon', FontAwesomeIcon);
For examples see the Storybook. While the code samples use lit-html syntax, this package does not require it.
In the event you need to share the page with other teams using different versions of this component, you'll need some sort of scoping. You can read more about the topic on open-wc.org.