All Projects → nuxt-community → Fontawesome Module

nuxt-community / Fontawesome Module

Licence: mit
Module to use Font Awesome icons in Nuxt.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fontawesome Module

Swifticons
🎢Swift Library for Font Icons - ★ this library
Stars: ✭ 747 (+845.57%)
Mutual labels:  fontawesome, icons, font-awesome
Alfred Font Awesome Workflow
🎩 Font Awesome workflow for Alfred
Stars: ✭ 714 (+803.8%)
Mutual labels:  fontawesome, icons, font-awesome
Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (+544.3%)
Mutual labels:  fontawesome, icons, font-awesome
react-native-fontawesome-pro
Easily use your FontAwesome Pro icons in React-Native
Stars: ✭ 44 (-44.3%)
Mutual labels:  fontawesome, icons, font-awesome
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (-40.51%)
Mutual labels:  fontawesome, icons, font-awesome
rofi-fontawesome
fontawesome icon list for rofi dmenu
Stars: ✭ 58 (-26.58%)
Mutual labels:  fontawesome, icons, font-awesome
Font Awesome Stylus
Stylus port for font-awesome 4.7.0
Stars: ✭ 77 (-2.53%)
Mutual labels:  fontawesome, icons, font-awesome
aurelia-fontawesome
Font Awesome 5 Aurelia component
Stars: ✭ 15 (-81.01%)
Mutual labels:  fontawesome, icons
fate
Browse FontAawesome icons from your shell
Stars: ✭ 26 (-67.09%)
Mutual labels:  icons, font-awesome
React Icons Kit
React Svg Icons
Stars: ✭ 352 (+345.57%)
Mutual labels:  fontawesome, icons
ukFontAwesome
Font Awesome icons for UIkit 3
Stars: ✭ 29 (-63.29%)
Mutual labels:  fontawesome, font-awesome
Radialmenu
A highly customizable radial menu that's very easy to setup.
Stars: ✭ 371 (+369.62%)
Mutual labels:  fontawesome, icons
Iconify Sketch
Sketch plug-in for importing over 70,000 icons from 80+ icon sets, including Material Design Icons, FontAwesome, Jam Icons, Open Emoji and many others.
Stars: ✭ 76 (-3.8%)
Mutual labels:  icons, font-awesome
Mahapps.metro.iconpacks
Awesome icon packs for WPF and UWP in one library
Stars: ✭ 1,157 (+1364.56%)
Mutual labels:  fontawesome, icons
FMX.FontAwesome
[FireMonkey] FontAwesome
Stars: ✭ 21 (-73.42%)
Mutual labels:  fontawesome, font-awesome
iconplus
Produce icons with extra effect like long shadow, flat shadow, box effect, circle effect and rounded rectangle effect. It support Dynamic text, Font-awesome icons and also google materialized icon. You can make any Font-awesome icon as line icon and add attractive effect to it dynamically. As a output you will get CSS3 code and also you can expo…
Stars: ✭ 34 (-56.96%)
Mutual labels:  icons, font-awesome
Fork Awesome
A fork of the iconic font and CSS toolkit
Stars: ✭ 878 (+1011.39%)
Mutual labels:  icons, font-awesome
fontawesome-subset
Creates subsets of FontAwesome fonts for optimized use on the web.
Stars: ✭ 41 (-48.1%)
Mutual labels:  fontawesome, icons
nuxt-netlify-lambda-starter
🛠️ SEO-friendly website starter backed by Netlify lambda functions in a simple, friendly repo
Stars: ✭ 60 (-24.05%)
Mutual labels:  nuxt, font-awesome
Font Awesome Swift
Font Awesome swift library for iOS.
Stars: ✭ 743 (+840.51%)
Mutual labels:  icons, font-awesome

@nuxtjs/fontawesome

npm version npm downloads Circle CI License

Module to use Font Awesome icons in your Nuxt.js project. Uses vue-fontawesome under the hood

📖 Release Notes

Setup

  • Add dependency using npm to your project
$ yarn add @nuxtjs/fontawesome -D

// or to also add the free icon packs

$ yarn add @nuxtjs/fontawesome @fortawesome/free-solid-svg-icons @fortawesome/free-brands-svg-icons -D
  • Add @nuxtjs/fontawesome to buildModules in your nuxt.config
  • Configure loaded icons/whole sets

Use the 'fontawesome' key:

  // nuxt.config.js
  buildModules: [
    '@nuxtjs/fontawesome',
  ],

  fontawesome: {
    icons: {
      solid: ['faCog', ...],
      ...
    }
  }
}

or include the options in the modules listing

  // nuxt.config.js
  buildModules: [
    ['@nuxtjs/fontawesome', {
      component: 'fa',
      suffix: true,
      proIcons: { // if you have bought the Pro packages
        // list the icons you want to add, not listed icons will be tree-shaked
        solid: [
          'faHome',
          'faHeart'
        ],
        // include all icons. But dont do this.
        regular: true
      }
    }]
  ]

Module options

component

  • Default: FontAwesomeIcon

Change component name. Eg set to fa to use <fa icon="" ... />. Also see suffix

It's strongly recommended to use PascalCase for component names

useLayers

  • Default: true

Boolean to indicate if the layers component should be registered globally. Name of the component will be ${options.component}-layers, fe <fa-layers ... />

useLayersText

  • Default: true

Boolean to indicate if the layers component should be registered globally. Name of the component will be the ${options.component}-layers-text, fe <fa-layers-text ... />

icons

Which icons you will use. FontAwesome currently supports 5 icon styles of which 3 are freely available (partially).

This option is an object with the style names as property and an array with all icon names you wish to use from those styles

  icons: {
    solid: [ 'faHome', ... ],
    regular: [ ... ],
    light: [ ... ],
    duotone: [ ... ],
    brands: [ ...]
  }

Although not recommended, you can use true to include the full icon set:

  icons: {
    solid: true
  }

proIcons

See icons for how to use, but always uses pro imports.

addCss

  • Default: true

If the module should automatically add the fontawesome styles to the global css config. It works by unshifting @fortawesome/fontawesome-svg-core/styles.css onto the nuxt.options.css property.

suffix

  • Default: false

Boolean whether to append -icon to the icon component name. This option exists as the component name option is also used for the layer components and you might not want to add '-icon' to those

  // config
  component: 'Fa',
  suffix: true

  // usage
  <fa-icon />
  <fa-layer />

  // config
  component: 'FaIcon',
  suffix: false

  // usage
  <fa-icon />
  <fa-icon-layers />

imports deprecated

Import icons/whole sets from chosen packages. This is the old configuration and will likely be removed in a future version. Use icons instead

  • Default: [], no icons will be imported here (see below, can be loaded later inside .vue file)
    • set - path to node package for import, like @fortawesome/free-solid-svg-icons
    • icons - array of icons to import ['faAdjust', 'faArchive'].
  imports: [
    {
      set: '@fortawesome/free-solid-svg-icons',
      icons: ['faHome']
    }
  ]

Usage

You can find more details under example folder. Also please see vue-fontawesome for additional reference

  • Ensure you have installed an icon package yarn add @fortawesome/free-solid-svg-icons -D
  • and have added the module configuration to your nuxt.config.js

Default component names are:

  • <font-awesome-icon>
  • <font-awesome-layers>
  • <font-awesome-layers-text>

With component option set, -layers and -layers-text suffixes will be appended (see example below)

  // nuxt.config
  fontawesome: {
    icons: {
      solid: ['faHome'],
      regular: ['faAdjust']
    }
  },
  • Use global icons:
<template>
  <div>
    <font-awesome-icon :icon="['fas', 'adjust']"  />
    <font-awesome-icon icon="dollar-sign"  style="font-size: 30px"/>
    <font-awesome-icon icon="cog"/>

    <font-awesome-layers class="fa-4x">
      <font-awesome-icon icon="circle"/>
      <font-awesome-icon icon="check" transform="shrink-6" :style="{ color: 'white' }"/>
    </font-awesome-layers>

    <font-awesome-layers full-width class="fa-4x">
      <font-awesome-icon icon="calendar"/>
      <font-awesome-layers-text transform="shrink-8 down-3" value="27" class="fa-inverse" />
    </font-awesome-layers>
  </div>
</template>

<script></script>
  • Use locally imported icons
<template>
    <div>
        <fa-layers full-width class="fa-4x">
          <fa :icon="fas.faCircle"/>
          <fa-layers-text transform="shrink-12" value="GALSD" class="fa-inverse" />
        </fa-layers>

        <fa :icon="fas.faAddressBook"  />
        <fa :icon="faGithub" />
    </div>
</template>

<script>
import { fas } from '@fortawesome/free-solid-svg-icons'
import { faGithub } from '@fortawesome/free-brands-svg-icons'

export default {
  computed: {
    fas () {
       return fas // NOT RECOMMENDED
    },
    faGithub () {
       return faGithub
    }
  },
}
</script>

Integrations

Storybook

If you are fan of storybook this might be interesting for you, This module provides a story to list and search available icons of your project. You can see stories under stories directory. If you are using @nuxtjs/storybook you can see the fontawesome stories under Modules section in your storybook. By default Font Awesome story will shows in your storybook, you disable/hide the story using Storybook's modules option

License

MIT License

This module was forked from the (font) awesome module created by Galley Web Development

Copyright (c) Nuxt Community

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].