All Projects → alphapeter → fa-svelte

alphapeter / fa-svelte

Licence: MIT license
Font Awesome 5 for svelte.js

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to fa-svelte

svelte-fa
Tiny FontAwesome 5 component for Svelte
Stars: ✭ 214 (+197.22%)
Mutual labels:  fontawesome, svelte, font-awesome, sveltejs
kahi-ui
Straight-forward Svelte UI for the Web
Stars: ✭ 169 (+134.72%)
Mutual labels:  svelte-components, svelte, sveltejs
react-native-fontawesome-pro
Easily use your FontAwesome Pro icons in React-Native
Stars: ✭ 44 (-38.89%)
Mutual labels:  fontawesome, font-awesome, fontawesome5
svelte-material
Modular and customizable Material Design UI components for Svelte.js
Stars: ✭ 30 (-58.33%)
Mutual labels:  svelte-components, svelte, sveltejs
svelte-progressbar
A multiseries, SVG progressbar component made with Svelte
Stars: ✭ 85 (+18.06%)
Mutual labels:  svelte-components, svelte, sveltejs
focus-svelte
focus lock for svelte
Stars: ✭ 18 (-75%)
Mutual labels:  svelte-components, svelte, sveltejs
s-date-range-picker
📅 A date range picker built with Svelte
Stars: ✭ 13 (-81.94%)
Mutual labels:  svelte-components, svelte, sveltejs
svelte-headlessui
Unofficial Svelte port of Headless UI components
Stars: ✭ 564 (+683.33%)
Mutual labels:  svelte-components, svelte, sveltejs
ui-svelte
A component library for Svelte
Stars: ✭ 18 (-75%)
Mutual labels:  svelte-components, svelte, sveltejs
Svelte Material Ui
Svelte Material UI Components
Stars: ✭ 2,081 (+2790.28%)
Mutual labels:  svelte-components, svelte, sveltejs
fa5pro-downloader
A tool that allows you to download Font Awesome 5 Pro for free
Stars: ✭ 34 (-52.78%)
Mutual labels:  fontawesome, font-awesome, fontawesome5
FontAwesome5
WPF controls for the iconic SVG, font, and CSS toolkit Font Awesome 5.
Stars: ✭ 93 (+29.17%)
Mutual labels:  fontawesome, fontawesome5
ukFontAwesome
Font Awesome icons for UIkit 3
Stars: ✭ 29 (-59.72%)
Mutual labels:  fontawesome, font-awesome
FMX.FontAwesome
[FireMonkey] FontAwesome
Stars: ✭ 21 (-70.83%)
Mutual labels:  fontawesome, font-awesome
fontawesome-subset
Creates subsets of FontAwesome fonts for optimized use on the web.
Stars: ✭ 41 (-43.06%)
Mutual labels:  fontawesome, fontawesome5
svelte-lottie-player
Lottie Player component for Svelte
Stars: ✭ 90 (+25%)
Mutual labels:  svelte-components, svelte
Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (+606.94%)
Mutual labels:  fontawesome, font-awesome
Swifticons
🎢Swift Library for Font Icons - ★ this library
Stars: ✭ 747 (+937.5%)
Mutual labels:  fontawesome, font-awesome
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (-34.72%)
Mutual labels:  fontawesome, font-awesome
vue-fa
Tiny FontAwesome 5 component for Vue.js.
Stars: ✭ 24 (-66.67%)
Mutual labels:  fontawesome, font-awesome

fa-svelte

Fontawesome 5 for svelte v3.x

(For svelte v2, use fa-svelte v1.x.x)

About

A simple minimalistic lightweight svelte component for Font Awesome SVG icons.

  • Small footprint
  • Only used icons will be bundled
  • No dependencies
  • Only SVG (no fonts)
  • Does not require additional CSS files

This library is currently not intended to be fully featured, it is the option when size and speed is of importance.

Installation

Install as a development dependency

npm install -D fa-svelte

Usage

Basic usage

Using font awesome solid Icons, first install them using npm

npm install @fortawesome/free-solid-svg-icons

<Icon icon={icon}>
</Icon>

<script>
import Icon from 'fa-svelte'
import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle'

let icon = faCircle;
</script>

Classes

<div>
  <Icon class="myClass1 myClass2" icon={faCircle}>
  </Icon>
</div>

<script>
import Icon from 'fa-svelte'
import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle'

let icon = faCircle;
</script>
<style>

div :global(.myClass1) {
    color: red;
}

div :global(.myClass2) {
    font-size: 14px;
}
</style>

Configuring webpack

If you're using webpack with svelte-loader, make sure that you add "svelte" to resolve.mainFields in your webpack config. This ensures that webpack imports the uncompiled component (src/Icon.svelte) rather than the compiled version (index.js) — this is more efficient and will also resolve component crash in runtime.

For a working web pack example, look at examples/webpack

Credits

This component is based on the template provided by sveltejs

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