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

heroicons-html-cdn

v1.0.14

Published

MIT‑licensed Heroicons as raw SVGs for HTML/Astro.

Readme

heroicons-html-cdn

A simple Node.js package to easily fetch Heroicons SVG strings for direct use in your HTML. This allows you to leverage the popular Heroicons library without the need for complex build configurations or component-based frameworks in certain scenarios.

Installation

You can install heroicons-html-cdn using npm:

npm install heroicons-html-cdn

Usage

Once installed, you can import the getIcon and getIconList functions into your JavaScript code:

import { getIcon, getIconList } from 'heroicons-html-cdn';

Getting a Specific Icon:

The getIcon function allows you to retrieve the SVG string for a specific Heroicon. It takes two arguments:

  1. style: The style of the icon ('outline' or 'solid').
  2. name: The name of the icon (e.g., 'user', 'bell', 'arrow-right').

It returns the SVG string for the requested icon, which you can then inject directly into your HTML.

Example (using Astro):

---
import { getIcon } from 'heroicons-html-cdn';
const svg = getIcon('outline', 'check-circle');
---

<div class="h-6 w-6 text-white" set:html={svg} />

Getting a List of Icons:

The getIconList function allows you to retrieve a list of available icon names for a specific style. It takes one argument:

  1. style: The style of the icons ('outline', 'solid', or 'mini').

It returns an array of strings, where each string is the name of an available icon in that style. For example:

const outlineIcons = getIconList('outline');
console.log(outlineIcons); // Output: ['academic-cap', 'adjustments', ...]

How to Find Icon Names:

You can find the complete list of available Heroicons and their names on the official Heroicons website:

  • Official Heroicons Website: https://heroicons.com/ (Browse the icons and note their names, which you'll use with the getIcon function.)

You can also explore the icon names by examining the filenames of the SVG icons in the official Heroicons GitHub repository:

Key Points:

  • Ensure you have installed the package using npm.

  • Import the getIcon function to retrieve SVG strings for specific icons.

  • Use the correct icon style and name (found on the Heroicons website or GitHub repository) with the getIcon function.

  • You can style the icons using CSS on the container element where you inject the SVG.