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

@gountzjs/icon-svg

v1.0.6

Published

Simple component managment svg element

Downloads

40

Readme

SVG Component

A lightweight, modern Web Component library for rendering SVG icons with ease. This library uses Shadow DOM for style encapsulation and isomorphic-dompurify for security.

Installation

You can install the library using your favorite package manager:

npm install @gountzjs/icon-svg

How to Use

1. Register your icons manually

This library does not come with pre-included icons. You must manually register the icons you want to use in your application's entry file (e.g., main.ts or app.ts).

Import the registry and use addIcons to provide your SVG icon functions:

import { registry, Icons } from '@gountzjs/icon-svg';

const myIcons: Icons = {
  'arrow-right': (color: string) => `
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="${color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
      <line x1="5" y1="12" x2="19" y2="12"></line>
      <polyline points="12 5 19 12 12 19"></polyline>
    </svg>
  `,
  'user': (color: string) => `
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="${color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
      <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
      <circle cx="12" cy="7" r="4"></circle>
    </svg>
  `
}

registry.addIcons(myIcons);

Note: The icon functions receive a color argument that you should inject into your SVG string (e.g., in the fill or stroke attribute).

2. Use the component

Once registered, you can use the <icon-svg> element anywhere in your HTML or templates:

<!-- Default: 24px, color #fff -->
<icon-svg name="arrow-right"></icon-svg>
<!-- Custom color and size -->
<icon-svg name="user" color="#ff4500" size="32px"></icon-svg>

Component API

The <icon-svg> component supports the following attributes:

| Attribute | Required | Default | Description | |-----------|----------|---------|-----------------------------------------| | name | Yes | - | The name of the registered icon. | | color | No | #fff | The color to pass to the icon function. | | size | No | 24px | The width and height of the component. |

Development

If you want to contribute or build the library locally:

# Install dependencies
pnpm install
# Build the library
pnpm run build

License

MIT