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

sa-icon

v1.0.1

Published

sa-icon is an Angular Component provides an easy way to preview and customize SVG icons in your Angular applications.

Readme

Sa Icon Component Documentation

The Angular Icon Component (sa-icon) provides an easy way to preview and customize SVG icons in your Angular applications.

Installation

Install the component using npm:

npm install sa-icon

Usage

Importing the Component

You can use the SaIconComponent either in an Angular module or as a standalone component.

Note: Please ensure to add your icons before starting the implementation. Go to add new Icons section

In AppModule:

import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { AppComponent } from "./app.component";
import { SaIconComponent } from "sa-icon";

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, SaIconComponent],
  bootstrap: [AppComponent],
})
export class AppModule {}

As a Standalone Component:

import { bootstrapApplication } from "@angular/platform-browser";
import { AppComponent } from "./app.component";
import { SaIconComponent } from "sa-icon";

bootstrapApplication(AppComponent, {
  imports: [SaIconComponent],
});

Using the Component

Add the sa-icon component to your HTML template:

<sa-icon icon="x"></sa-icon>

Component Inputs

| Input | Type | Default | Description | | -------- | -------- | -------------------- | -------------------------------------------- | | icon | string | '' | The ID of the icon to display (e.g., x). | | path | string | SaIconService.path | Path to the SVG file containing the icons. | | size | number | SaIconService.size | Default size of the icon (width and height). | | width | number | size | Custom width for the icon. | | height | number | size | Custom height for the icon. |

Example:

<sa-icon path="assets/custom-icons.svg" icon="check" size="30"></sa-icon>

Global Configuration

You can set global configurations for the component using Angular providers:

import { SaIconService } from "sa-icon";
import { IconConfig } from "sa-icon";

@NgModule({
  providers: [
    {
      provide: SaIconService,
      useValue: {
        config: {
          path: "assets/custom-icons/icons.svg",
          size: 32,
        } as IconConfig,
      },
    },
  ],
})
export class AppModule {}

Adding New Icons {#icons}

Step 1: Prepare the SVG File

You should have an SVG file containing all your icons. The file should use the <symbol> tag for each icon.

Example Existing File

<svg fill="none" xmlns="http://www.w3.org/2000/svg">
  <symbol id="x" fill="none" viewBox="0 0 24 24">
    <path fill-rule="evenodd" clip-rule="evenodd" d="M2.10964 2.54475C2.2806..." fill="currentColor"></path>
  </symbol>
</svg>

Step 2: Add the New Icon

Suppose you want to add a Facebook icon. Here’s the Facebook SVG:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none">
    <path d="M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z" stroke="#ff00ff" stroke-width="1.5" stroke-linejoin="round" />
    <path d="M16.9265 8.02637H13.9816C12.9378 8.02637 12.0894 8.86847 12.0817 9.91229L11.9964 21.4268M10.082 14.0017H14.8847" stroke="#ff00ff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</svg>

You need to copy its contents and wrap them in a <symbol> tag. Replace static colors (#ff00ff) with currentColor so you can style it using CSS. Ensure that you have an SVG file containing icons structured with <symbol> elements. For example:

<svg fill="none" xmlns="http://www.w3.org/2000/svg">
  <symbol id="x" fill="none" viewBox="0 0 24 24">
    <path fill-rule="evenodd" clip-rule="evenodd" d="M2.10964 2.54475C2.2806..." fill="currentColor"></path>
  </symbol>
</svg>

Step 3: Updated SVG File with Facebook Icon

<svg fill="none" xmlns="http://www.w3.org/2000/svg">
  <symbol id="x" fill="none" viewBox="0 0 24 24">
    <path fill-rule="evenodd" clip-rule="evenodd" d="M2.10964 2.54475C2.2806..." fill="currentColor"></path>
  </symbol>
  <symbol id="facebook" fill="none" viewBox="0 0 24 24">
    <path d="M2.5 12C2.5 7.52166 2.5 5.28249 3.89124 3.89124C5.28249 2.5 7.52166 2.5 12 2.5C16.4783 2.5 18.7175 2.5 20.1088 3.89124C21.5 5.28249 21.5 7.52166 21.5 12C21.5 16.4783 21.5 18.7175 20.1088 20.1088C18.7175 21.5 16.4783 21.5 12 21.5C7.52166 21.5 5.28249 21.5 3.89124 20.1088C2.5 18.7175 2.5 16.4783 2.5 12Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" />
    <path d="M16.9265 8.02637H13.9816C12.9378 8.02637 12.0894 8.86847 12.0817 9.91229L11.9964 21.4268M10.082 14.0017H14.8847" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
  </symbol>
</svg>

Step 4: Use the New Icon

Now, you can use the new facebook icon like this:

<sa-icon icon="facebook"></sa-icon>

Important Notes:

  • The fill property on the <symbol> tag must be none.
  • Use currentColor for fill or stroke properties in the icon paths to allow color customization via CSS.

License

This project is licensed under the MIT License.