Installations
npm install svelte-fa
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
20.10.0
NPM Version
8.6.0
Score
92.9
Supply Chain
98.4
Quality
77
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
Svelte (51.58%)
TypeScript (29.47%)
JavaScript (18.39%)
HTML (0.45%)
SCSS (0.1%)
Developer
Download Statistics
Total Downloads
1,869,137
Last Day
2,806
Last Week
13,273
Last Month
59,441
Last Year
714,741
GitHub Statistics
403 Stars
270 Commits
26 Forks
7 Watching
7 Branches
13 Contributors
Bundle Size
1.56 kB
Minified
463.00 B
Minified + Gzipped
Package Meta Information
Latest Version
4.0.3
Package Id
svelte-fa@4.0.3
Unpacked Size
24.00 kB
Size
6.39 kB
File Count
15
NPM Version
8.6.0
Node Version
20.10.0
Publised On
24 Sept 2024
Total Downloads
Cumulative downloads
Total Downloads
1,869,137
Last day
-12.7%
2,806
Compared to previous day
Last week
-20.3%
13,273
Compared to previous week
Last month
-2.3%
59,441
Compared to previous month
Last year
38.4%
714,741
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
Dev Dependencies
25
svelte-fa
Tiny FontAwesome component for Svelte.
- FontAwesome version 5 and 6
- FontAwesome svg icons
- Tree-shakable, only import used icons
- No CSS file required
- FontAwesome layering
- FontAwesome duotone icons
Installation
1npm install svelte-fa
Install FontAwesome icons via official packages, for example:
1npm install @fortawesome/free-solid-svg-icons 2npm install @fortawesome/free-brands-svg-icons
Icons gallery: FontAwesome icons
Work with Sapper
You may need to install the component as a devDependency:
1npm install svelte-fa -D
Work with SvelteKit/Vite
You may need to import the component explicitly as below:
1import Fa from 'svelte-fa/dist/fa.svelte' 2import { faCaretDown, faCaretUp } from '@fortawesome/free-solid-svg-icons/index.es'
When using typescript with SvelteKit/Vite, you may also needed to add type definitions that redirect to the non-index.es
export:
1// app.d.ts 2declare module '@fortawesome/pro-solid-svg-icons/index.es' { 3 export * from '@fortawesome/pro-solid-svg-icons'; 4}
Usage
1<script> 2import Fa from 'svelte-fa' 3import { faFlag } from '@fortawesome/free-solid-svg-icons' 4import { faGithub } from '@fortawesome/free-brands-svg-icons'; 5</script> 6 7<Fa icon={faFlag} /> 8<Fa icon={faGithub} />
Fa
Properties
1<Fa 2 icon={faFlag} 3 class="bg-gold" 4 size="2x" 5 color="#ff0000" 6 fw 7 pull="left" 8 scale={1.2} 9 translateX={0.2} 10 translateY={0.2} 11 rotate={90} 12 flip="horizontal" 13 spin 14 pulse 15/>
icon
: icon from FontAwesome packages, for example:@fortawesome/free-solid-svg-icons
, icons gallery: FontAwesome iconsclass
:string
values${your preffered any css class}
size
:string
valuesxs
,sm
,lg
or2x
,3x
,4x
, ...,${number}x
color
:string
icon color, defaultcurrentColor
fw
:boolean
fixed widthpull
:string
valuesleft
,right
scale
:number | string
transform scale, unit isem
, default1
translateX
:number | string
transform position X, unit isem
, default0
translateY
:number | string
transform position Y, unit isem
, default0
flip
:string
valueshorizontal
,vertical
,both
rotate
:number | string
values90
,180
,270
,30
,-30
...spin
:boolean
spin iconspulse
:boolean
pulse spin icons
Layering & Text
1import Fa, { 2 FaLayers, 3 FaLayersText, 4} from 'svelte-fa';
1<FaLayers 2 size="4x" 3 pull="left" 4> 5 <Fa icon={faCertificate} /> 6 <FaLayersText 7 scale={0.25} 8 rotate={-30} 9 color="white" 10 style="font-weight: 900" 11 > 12 NEW 13 </FaLayersText> 14</FaLayers>
FaLayers
Properties
size
:string
valuesxs
,sm
,lg
or2x
,3x
,4x
, ...,${number}x
pull
:string
valuesleft
,right
FaLayersText
Properties
size
:string
valuesxs
,sm
,lg
or2x
,3x
,4x
, ...,${number}x
color
:string
icon color, defaultcurrentColor
scale
:number | string
transform scale, unit isem
, default1
translateX
:number | string
transform position X, unit isem
, default0
translateY
:number | string
transform position Y, unit isem
, default0
flip
:string
valueshorizontal
,vertical
,both
rotate
:number | string
values90
,180
,270
,30
,-30
...
Duotone Icons
1<script> 2import Fa from 'svelte-fa' 3import { faFlag } from '@fortawesome/pro-duotone-svg-icons' 4</script> 5 6<Fa 7 icon={faFlag} 8 primaryColor="red" 9 secondaryColor="#000000" 10 primaryOpacity={0.8} 11 secondaryOpacity={0.6} 12 swapOpacity 13/>
Duotone Icons Theme
1<script> 2import Fa from 'svelte-fa' 3import { faFlag } from '@fortawesome/pro-duotone-svg-icons' 4 5const theme = { 6 primaryColor: 'red', 7 secondaryColor: '#000000', 8 primaryOpacity: 0.8, 9 secondaryOpacity: 0.6, 10} 11</script> 12 13<Fa 14 icon={faFlag} 15 {...theme} 16/>
Contributors
Cweili |
Marek Dědič |
Gtmnayan |
Rui Sousa |
Theodore Brown |
Mirco Sanguineti |
Alon Krymgand |
Conner |
Kawsar Ahmed |
Mark Volkmann |
Robin Modisch |
Rémi Kalbe |
Null |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
Found 7/21 approved changesets -- score normalized to 3
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/contributor.yml:1
- Info: topLevel 'contents' permission set to 'read': .github/workflows/deploy.yml:15
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/ci.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/contributor.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/contributor.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/deploy.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/deploy.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/deploy.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/deploy.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/Cweili/svelte-fa/deploy.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:20
- Warn: npmCommand not pinned by hash: .github/workflows/deploy.yml:41
- Info: 0 out of 7 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 2 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Score
3.7
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More