All Projects → Cweili → svelte-fa

Cweili / svelte-fa

Licence: MIT license
Tiny FontAwesome 5 component for Svelte

Programming Languages

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

Projects that are alternatives of or similar to svelte-fa

fa-svelte
Font Awesome 5 for svelte.js
Stars: ✭ 72 (-66.36%)
Mutual labels:  fontawesome, svelte, font-awesome, sveltejs
Svelte Awesome
Awesome SVG icon component for Svelte JS, built with Font Awesome icons. Based on Justineo/vue-awesome
Stars: ✭ 193 (-9.81%)
Mutual labels:  svelte, font-awesome, icon
vue-fa
Tiny FontAwesome 5 component for Vue.js.
Stars: ✭ 24 (-88.79%)
Mutual labels:  fontawesome, font-awesome, icon
Anicon
Animated icons for R markdown and Shiny apps
Stars: ✭ 109 (-49.07%)
Mutual labels:  fontawesome, font-awesome, icon
generator-jhipster-svelte
Generate Svelte powered JHipster web applications
Stars: ✭ 44 (-79.44%)
Mutual labels:  svelte, sveltejs
svelte-undoable
Memento design pattern in Svelte
Stars: ✭ 39 (-81.78%)
Mutual labels:  svelte, sveltejs
eslint-plugin-svelte
ESLint plugin for Svelte using AST
Stars: ✭ 22 (-89.72%)
Mutual labels:  svelte, sveltejs
nomie5
Nomie v5 Source Code
Stars: ✭ 528 (+146.73%)
Mutual labels:  svelte, sveltejs
ModalFileManager
A file manager built using Svelte and Wails. It has hotkeys that are modal just like Vim and NeoVim.
Stars: ✭ 21 (-90.19%)
Mutual labels:  svelte, sveltejs
svelte-eslint-parser
Svelte parser for ESLint
Stars: ✭ 30 (-85.98%)
Mutual labels:  svelte, sveltejs
rofi-fontawesome
fontawesome icon list for rofi dmenu
Stars: ✭ 58 (-72.9%)
Mutual labels:  fontawesome, font-awesome
svelte-material
Modular and customizable Material Design UI components for Svelte.js
Stars: ✭ 30 (-85.98%)
Mutual labels:  svelte, sveltejs
svelte-typewriter
A simple and reusable typewriter effect for your Svelte applications
Stars: ✭ 204 (-4.67%)
Mutual labels:  svelte, sveltejs
svelte-accessible-dialog
An accessible dialog component for Svelte apps
Stars: ✭ 24 (-88.79%)
Mutual labels:  svelte, sveltejs
fa5pro-downloader
A tool that allows you to download Font Awesome 5 Pro for free
Stars: ✭ 34 (-84.11%)
Mutual labels:  fontawesome, font-awesome
svelte-intl
Internationalize your Svelte apps using format-message and Intl object
Stars: ✭ 48 (-77.57%)
Mutual labels:  svelte, sveltejs
svelte-simple-icons
📦 This package provides the Simple Icons packaged as a set of Svelte components.
Stars: ✭ 27 (-87.38%)
Mutual labels:  svelte, sveltejs
its-ok-i-guess
🧐 Guess the game from the Steam review!
Stars: ✭ 41 (-80.84%)
Mutual labels:  svelte, sveltejs
svelte-toy
A toy for svelte data stores
Stars: ✭ 73 (-65.89%)
Mutual labels:  svelte, sveltejs
templates
tsParticles website templates collection
Stars: ✭ 42 (-80.37%)
Mutual labels:  svelte, sveltejs

svelte-fa

npm bundle size npm downloads license

github workflows coverage

Tiny FontAwesome 5 component for Svelte.

  • FontAwesome svg icons
  • Tree-shakable, only import used icons
  • No CSS file required
  • FontAwesome layering
  • FontAwesome duotone icons

Documents and examples.

Installation

npm install svelte-fa

Install FontAwesome icons via official packages, for example:

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

Notice for Sapper user: You may need to install the component as a devDependency:

npm install svelte-fa -D

Notice for Svelte Kit user: You may need to import the component explicitly as below:

import Fa from 'svelte-fa/src/fa.svelte'

Usage

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

<Fa icon={faFlag} />

Fa Properties

<Fa
  icon={faFlag}
  size="2x"
  color="#ff0000"
  fw
  pull="left"
  scale={1.2}
  translateX={0.2}
  translateY={0.2}
  rotate={90}
  flip="horizontal"
  spin
  pulse
/>
  • icon: icon from FontAwesome packages, for example: @fortawesome/free-solid-svg-icons
  • size: string values xs, sm, lg or 2x, 3x, 4x, ..., 10x
  • color: string icon color, default currentColor
  • fw: boolean fixed width
  • pull: string values left, right
  • scale: number | string transform scale, unit is em, default 1
  • translateX: number | string transform position X, unit is em, default 0
  • translateY: number | string transform position Y, unit is em, default 0
  • flip: string values horizontal, vertical, both
  • rotate: number | string values 90, 180, 270, 30, -30 ...
  • spin: boolean spin icons
  • pulse: boolean pulse spin icons

Layering & Text

import Fa, {
  FaLayers,
  FaLayersText,
} from 'svelte-fa';
<FaLayers
  size="4x"
  pull="left"
>
  <Fa icon={faCertificate} />
  <FaLayersText
    scale={0.25}
    rotate={-30}
    color="white"
    style="font-weight: 900"
  >
    NEW
  </FaLayersText>
</FaLayers>

FaLayers Properties

  • size: string values xs, sm, lg or 2x, 3x, 4x, ..., 10x
  • pull: string values left, right

FaLayersText Properties

  • size: string values xs, sm, lg or 2x, 3x, 4x, ..., 10x
  • color: string icon color, default currentColor
  • scale: number | string transform scale, unit is em, default 1
  • translateX: number | string transform position X, unit is em, default 0
  • translateY: number | string transform position Y, unit is em, default 0
  • flip: string values horizontal, vertical, both
  • rotate: number | string values 90, 180, 270, 30, -30 ...

Duotone Icons

<script>
import Fa from 'svelte-fa'
import { faFlag } from '@fortawesome/pro-duotone-svg-icons'
</script>

<Fa
  icon={faFlag}
  primaryColor="red"
  secondaryColor="#000000"
  primaryOpacity={0.8}
  secondaryOpacity={0.6}
  swapOpacity
/>

Duotone Icons Theme

<script>
import Fa from 'svelte-fa'
import { faFlag } from '@fortawesome/pro-duotone-svg-icons'

const theme = {
  primaryColor: 'red',
  secondaryColor: '#000000',
  primaryOpacity: 0.8,
  secondaryOpacity: 0.6,
}
</script>

<Fa
  icon={faFlag}
  {...theme}
/>
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].