npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

solid-fa6-pro

v3.1.0

Published

Font Awesome 6.6 Pro components for solid-js

Downloads

627

Readme

solid-fa6-pro

Font Awesome 6.6 Pro components for solid-js

Objective

This package aims to provide a customizable component for each icon in Font Awesome 6.6 Pro for free, but with some peculiarities:

  • Non global: There are no global clas1s like "fad", "fa-circle-xmark", etc...
  • Separate fonts: Each icon has its own specific font
  • Completely tree shakable: You can import each icon separately, in fact you actually can't do otherwise since there are A LOT of icons
  • TypeScript package: The package is not compiled, it ships directly in TypeScript and SCSS

Usage

To use an icon simply import it as follows

//                                     ↓ Category
import CircleXmark from "solid-fa6-pro/duotone/circle-xmark";
//                                             ↑ Name

function CancelButton() {
	return <>
		<button style={{ display: "flex", "justify-content": "center", "align-items": "center" }}>
			<CircleXmark fill="red" />&nbsp;Cancel
		</button>
	</>
}

Styles

The library also provides a couple of style sheets, each containing some classes.

Each class can also be applied to non-icons except generic.reverse

anim

Style sheet that contains animations

  • beat (fa-beat): Makes the element increase and decrease in size
  • fade (fa-fade): Makes the element "blink"
  • beatFade (fa-beat-fade): Sum of anim.beat and anim.fade
  • bounce (fa-bounce): Makes the element do a little jump
  • flip (fa-flip): Make the element do a 3D rotation around the Y axis
  • shake (fa-shake): Makes the element rotate a bit back and forward multiple times
  • spin (fa-spin): Makes the element rotate
  • pulse (fa-pulse, fa-spin-pulse): Does the same thing as anim.spin, but "lagging"

generic

Style sheets that contains generic functionalities

  • reverse (fa-spin-reverse): Sets IconOpts.animationDirection to "reverse"
  • rotateBy (fa-rotate-by): Rotates the element by IconOpts.rotateAngle
  • rotate90 (fa-rotate-90): Rotates the element by 90°
  • rotate180 (fa-rotate-180): Rotates the element by 180°
  • rotate270 (fa-rotate-270): Rotates the element by 270°
  • flipHorizontal (fa-flip-horizontal): Flips the element horizontally
  • flipVertical (fa-flip-vertical): Flips the element vertically
  • flipBoth (fa-flip-both): Flips the element horizontally and vertically

Utility

Utilities for customization and primitives

CSS_VARIABLE_PREFIX

The prefix each customization CSS variable has

IconOpts

Type that lists the available customization CSS variables

createIcon()

Creates a new icon component based on the provided font

custom()

Takes an IconOpts as argument and prefixes each of its properties with CSS_VARIABLE_PREFIX

import SpinnerThird from "solid-fa6-pro/duotone/spinner-third";
import { anim, custom } from "solid-fa6-pro";

function App() {
	return <>
		<SpinnerThird
			fill="#ffc107"
			class={anim.spin}
			style={custom({ animationDuration: "2s" })}
		/>
	</>
}

The values of customization variables are inherited and can be combined with normal CSS

// ...
<div style={{ color: "red", ...custom({ animationDuration: "2s" }) }}>
	Text
	<SpinnerThird fill="#ffc107" class={anim.spin} />
</div>
// ...