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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@polarityio/pi-icon

v1.0.3

Published

FontAwesome SVG icon component with configurable size, color, and spin animation

Readme

Polarity Integration Component Library

Icon Component

Renders FontAwesome SVG icons with named sizes, semantic colors, and optional spin animation.

Installation

npm install @polarityio/pi-icon

Peer Dependencies

Usage

import '@polarityio/pi-icon';
import { faStar, faShieldHalved, faSpinner, faBell } from '@polarityio/pi-icon';

Basic Icon

import { html } from 'lit';
import { faStar } from '@fortawesome/free-solid-svg-icons';

html`<pi-icon .icon=${faStar}></pi-icon>`;

Sized and Colored Icon

import { html } from 'lit';
import { faShieldHalved } from '@fortawesome/free-solid-svg-icons';

html`<pi-icon .icon=${faShieldHalved} size="lg" color="success"></pi-icon>`;

Spinning Icon

import { html } from 'lit';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';

html`<pi-icon .icon=${faSpinner} spin></pi-icon>`;

Accessible Icon with Label

import { html } from 'lit';
import { faBell } from '@fortawesome/free-solid-svg-icons';

html`<pi-icon .icon=${faBell} label="Notifications"></pi-icon>`;

Icons Export

The package re-exports all FontAwesome Free Solid SVG icons from @fortawesome/free-solid-svg-icons:

import { faStar, faUser, faGear, faBell } from '@polarityio/pi-icon';

This is a convenience re-export — you can import any icon from the FontAwesome Free Solid set directly through this package.

API Reference

Properties

| Property | Type | Default | Description | | ----------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------- | | icon | IconDefinition \| undefined | undefined | The FontAwesome icon definition to render. | | size | 'xs' \| 'sm' \| 'base' \| 'lg' \| 'xl' \| '2xl' \| undefined | undefined | Named size of the icon. | | color | 'primary' \| 'secondary' \| 'success' \| 'warning' \| 'danger' \| 'info' \| 'urgent' \| 'inverse' \| 'disabled' \| undefined | undefined | Semantic color variant. | | label | string \| undefined | undefined | Accessible label for screen readers. When set, the icon gets role="img". | | spin | boolean | false | Enables continuous rotation animation. Reflected to attribute. | | spinSpeed | string \| undefined | undefined | CSS time value for animation duration (e.g., '0.5s', '2s'). Set via spin-speed attribute. |

CSS Custom Properties

| Property | Default | Description | | ---------------------- | -------------- | ---------------------------------- | | --pi-icon-size | 16px | Override the default icon size. | | --pi-icon-color | currentColor | Override the icon color. | | --pi-icon-spin-speed | 2s | Override the spin animation speed. | | --pi-icon-size-xs | 12px | Size for size="xs". | | --pi-icon-size-sm | 14px | Size for size="sm". | | --pi-icon-size-base | 16px | Size for size="base". | | --pi-icon-size-lg | 20px | Size for size="lg". | | --pi-icon-size-xl | 24px | Size for size="xl". | | --pi-icon-size-2xl | 32px | Size for size="2xl". |

Color Token Mapping

When using the color property, the icon color is set via the corresponding design token:

| Color Value | CSS Token Used | | ----------- | --------------------------- | | primary | --pi-color-font-primary | | secondary | --pi-color-font-secondary | | success | --pi-color-font-success | | warning | --pi-color-font-warning | | danger | --pi-color-font-danger | | info | --pi-color-font-info | | urgent | --pi-color-font-urgent | | inverse | --pi-color-font-inverse | | disabled | --pi-color-font-disabled |

Accessibility

  • When no label is provided, the icon is decorative: role="presentation" and aria-hidden="true".
  • When label is provided, the icon is semantic: role="img" and aria-label is set.

Theming

Customize the appearance using CSS custom properties. This component uses design tokens from @polarityio/pi-shared for consistent theming across the component library.

License

MIT