All Projects → pinterweb → aurelia-fontawesome

pinterweb / aurelia-fontawesome

Licence: MIT License
Font Awesome 5 Aurelia component

Programming Languages

typescript
32286 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to aurelia-fontawesome

Mahapps.metro.iconpacks
Awesome icon packs for WPF and UWP in one library
Stars: ✭ 1,157 (+7613.33%)
Mutual labels:  fontawesome, icons
React Native Fontawesome
React Native Font Awesome Icons
Stars: ✭ 173 (+1053.33%)
Mutual labels:  fontawesome, icons
Font Awesome Stylus
Stylus port for font-awesome 4.7.0
Stars: ✭ 77 (+413.33%)
Mutual labels:  fontawesome, icons
Swifticons
🎢Swift Library for Font Icons - ★ this library
Stars: ✭ 747 (+4880%)
Mutual labels:  fontawesome, icons
aurelia-knockout
Adds support for Knockout binding syntax to make transition from Durandal and Knockout to Aurelia simpler.
Stars: ✭ 22 (+46.67%)
Mutual labels:  aurelia, aurelia-plugins
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (+213.33%)
Mutual labels:  fontawesome, icons
Yii2 Fontawesome
Asset Bundle for Yii2 with Font Awesome http://fortawesome.github.io/Font-Awesome/
Stars: ✭ 149 (+893.33%)
Mutual labels:  fontawesome, icons
React Icons Kit
React Svg Icons
Stars: ✭ 352 (+2246.67%)
Mutual labels:  fontawesome, icons
aurelia-mdc-plugin
MDC (Material Design UI Components) plugin for Aurelia.
Stars: ✭ 13 (-13.33%)
Mutual labels:  aurelia, aurelia-plugins
aurelia-mdl-plugin
Material Design Lite plugin for Aurelia.
Stars: ✭ 19 (+26.67%)
Mutual labels:  aurelia, aurelia-plugins
Alfred Font Awesome Workflow
🎩 Font Awesome workflow for Alfred
Stars: ✭ 714 (+4660%)
Mutual labels:  fontawesome, icons
aurelia-virtual-scroll
Aurelia Virtual Scroller
Stars: ✭ 15 (+0%)
Mutual labels:  aurelia, aurelia-plugins
Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (+3293.33%)
Mutual labels:  fontawesome, icons
Angular Fontawesome
Official Angular component for Font Awesome 5
Stars: ✭ 1,056 (+6940%)
Mutual labels:  fontawesome, icons
Radialmenu
A highly customizable radial menu that's very easy to setup.
Stars: ✭ 371 (+2373.33%)
Mutual labels:  fontawesome, icons
Fontawesome Module
Module to use Font Awesome icons in Nuxt.js
Stars: ✭ 79 (+426.67%)
Mutual labels:  fontawesome, icons
react-native-fontawesome-pro
Easily use your FontAwesome Pro icons in React-Native
Stars: ✭ 44 (+193.33%)
Mutual labels:  fontawesome, icons
Font Awesome
The iconic SVG, font, and CSS toolkit
Stars: ✭ 66,937 (+446146.67%)
Mutual labels:  fontawesome, icons
rofi-fontawesome
fontawesome icon list for rofi dmenu
Stars: ✭ 58 (+286.67%)
Mutual labels:  fontawesome, icons
fontawesome-subset
Creates subsets of FontAwesome fonts for optimized use on the web.
Stars: ✭ 41 (+173.33%)
Mutual labels:  fontawesome, icons

aurelia-fontawesome

Font Awesome 5 Aurelia component using SVG with JS

Build Status Conventional Commits

Inspired by: react-fontawesome and vue-fontawesome

Installation

Visit fontawesome.com/icons to search for free and Pro icons

$ npm i --save @fortawesome/fontawesome-svg-core

Select one or all icon libraries

$ npm i --save @fortawesome/free-solid-svg-icons
$ npm i --save @fortawesome/free-regular-svg-icons
$ npm i --save @fortawesome/free-brands-svg-icons

Aurelia Plugin

$ npm i --save aurelia-fontawesome

Usage

In your Aurelia bootstrap file, add the plugin:

Zero Configuration

import { PLATFORM } from "aurelia-framework";

export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .plugin(PLATFORM.moduleName("aurelia-fontawesome"));

  // other code ...

  return aurelia
    .start()
    .then(() => aurelia.setRoot(PLATFORM.moduleName("app")));
}

Default Configuration

import { PLATFORM } from 'aurelia-framework';
import { fab } from "@fortawesome/free-brands-svg-icons";
import {
  faCircle,
  faHome,
  faSpinner,
  faCoffee,
  faMugHot
} from "@fortawesome/free-solid-svg-icons";

export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .plugin(PLATFORM.moduleName('aurelia-fontawesome'), {
      iconOptions: { /* bindable property defaults here (e.g rotation: 0) */ },,
      icons: [ fab, faCircle, faHome, faSpinner, faCoffee, faMugHot ]
    });

  // other code ...

  return aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
}

Explicit Import

Explicitly import the icon(s) into your view model(s)

foobar.js

import { faCoffee } from "@fortawesome/free-solid-svg-icons";

export class FooBarViewModel {
  coffeeIcon = faCoffee;
}

foobar.html

<template>
  <font-awesome-icon icon.bind="coffeeIcon"></font-awesome-icon>
</template>

Explicitly importing icons like this allows us to subset Font Awesome's thousands of icons to include only those you use in your final bundled file. for an alternative approach check out webpack loader aurelia-fontawesome-loader

Non FAS icons

foobar.js

export class FooBarViewModel {}

foobar.html

<template>
  <font-awesome-icon icon.bind="['fab', 'apple']"><font-awesome-icon>
  <font-awesome-icon icon.bind="['fab', 'microsoft']"><font-awesome-icon>
  <font-awesome-icon icon.bind="['fab', 'google']"><font-awesome-icon>
</template>

The "check-square" icon is getting a default prefix of fas here too, which is what we want, because that icon also lives in the @fortawesome/free-solid-svg-icons package.

However, the "apple", "microsoft", and "google" brand icons live in the package @fortawesome/free-brands-svg-icons. So we need to specify a different prefix for them—not the default fas, but fab, for Font Awesome

Binding Variations

  • The icon can be an icon object, like icon.bind=${faCoffee}.
  • The icon can be a string, like icon="coffee".
  • The icon can be an Array of strings, where the first element is a prefix, and the second element is the icon name: icon.bind="['fab', 'apple']"
  • The prefix can be bound, the default is fas: prefix="fab" icon="apple"
  • A default prefix can be setup in the plugin configuration: { prefix="fab" }

Dependencies

Building The Code

To build the code, follow these steps.

  1. From the project folder, execute the following command:
npm install
  1. To build the production files, run:
npm run build
  1. You will find the compiled code in the dist folder, available in various module formats.

Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

  1. For single execution run:
npm run test
  1. For continuous tdd style:
npm run test:watch

Running The Examples

  1. From the project folder, execute the following command:
npm start
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].