0.1.3 • Published 4 years ago

sveltejs-fontawesome v0.1.3

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

sveltejs-fontawesome

  • Sapper support
  • Duotone support

Installation

For Svelte

npm i sveltejs-fontawesome

For Sapper

npm i -D sveltejs-fontawesome

Requirements

npm i @fortawesome/fontawesome-svg-core

Usage

Install the icons your want

Free icons

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

Pro icons

More info here

npm i @fortawesome/pro-solid-svg-icons
npm i @fortawesome/pro-regular-svg-icons
npm i @fortawesome/pro-light-svg-icons
npm i @fortawesome/pro-duotone-svg-icons

Example

<script>
  import Fa from "sveltejs-fontawesome"
  import { faCircle } from '@fortawesome/free-solid-svg-icons'
</script>

<Fa>
  icon={faCircle}
  size="sm"
  color="#000000"
</Fa>

Attributes

AttributeUsage
icon requiredThe icon you imported from font awesome
colorCan be anything that the fill svg property supports
secondaryColorIf you are using Duotone it's the secondary color
secondaryOpacityIf you are using Duotone it's the opacity of the secondary color
sizeCan be a string from this list (without the fa-) or a standard css size in any units.
flipCan be "h" for horizontal flip, "v" for vertical flip, or "hv" for both.
rotateIn degrees
styleCustom css style on the <svg>