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 🙏

© 2025 – Pkg Stats / Ryan Hefner

astrojs-heroicons

v1.0.0

Published

Typed Astro components for Heroicons with intellisense support and type definitions.

Readme

🎨 astrojs-heroicons

Beautiful Heroicons as fully-typed Astro components with IntelliSense support.

npm version License: MIT

✨ Features

  • 🎯 1,200+ icons in 4 variants (Outline, Solid, Mini, Micro)
  • 🔍 Full TypeScript support with IntelliSense autocomplete
  • 📦 Tree-shakeable - only import what you use
  • 🎨 Fully customizable - accepts all SVG/HTML attributes
  • Zero runtime overhead - compiled at build time
  • 🧩 Native Astro components - no framework wrappers needed

📦 Installation

npm install astrojs-heroicons
# or
yarn add astrojs-heroicons
# or
pnpm add astrojs-heroicons

🚀 Quick Start

---
import { HomeOutline, UserSolid, CheckMini, XMarkMicro } from 'astrojs-heroicons';
---

<div class="flex gap-4">
  <HomeOutline class="w-6 h-6 text-blue-500" />
  <UserSolid class="w-6 h-6 text-green-500" />
  <CheckMini class="w-5 h-5 text-purple-500" />
  <XMarkMicro class="w-4 h-4 text-red-500" />
</div>

📖 Usage

Icon Variants

Each icon comes in 4 variants with different names:

| Variant | Size | Naming Pattern | Example | | ----------- | ----- | --------------- | ------------- | | Outline | 24×24 | {Name}Outline | HomeOutline | | Solid | 24×24 | {Name}Solid | HomeSolid | | Mini | 20×20 | {Name}Mini | HomeMini | | Micro | 16×16 | {Name}Micro | HomeMicro |

Import Styles

Main entry (all icons):

---
import { HomeOutline, UserSolid } from 'astrojs-heroicons';
---

Subpath imports (for smaller bundles):

---
import { HomeOutline } from 'astrojs-heroicons/outline';
import { UserSolid } from 'astrojs-heroicons/solid';
import { CheckMini } from 'astrojs-heroicons/mini';
import { XMarkMicro } from 'astrojs-heroicons/micro';
---

Customization

All icons accept standard SVG and HTML attributes:

---
import { HeartSolid } from 'astrojs-heroicons';
---

<!-- Custom styling -->
<HeartSolid
  class="w-8 h-8 text-red-500 hover:text-red-600 transition-colors"
/>

<!-- Accessibility attributes -->
<HeartSolid
  aria-label="Like this post"
  role="img"
  class="w-6 h-6"
/>

<!-- Data attributes -->
<HeartSolid
  data-action="like"
  data-id="123"
  class="w-6 h-6 cursor-pointer"
/>

<!-- Inline styles -->
<HeartSolid
  style="width: 2rem; height: 2rem; color: hotpink;"
/>

<!-- All SVG attributes work -->
<HeartSolid
  width="32"
  height="32"
  fill="currentColor"
  stroke="none"
/>

Real-World Examples

Navigation Menu:

---
import { HomeOutline, UserOutline, CogOutline } from 'astrojs-heroicons';
---

<nav class="flex gap-6">
  <a href="/" class="flex items-center gap-2">
    <HomeOutline class="w-5 h-5" />
    <span>Home</span>
  </a>
  <a href="/profile" class="flex items-center gap-2">
    <UserOutline class="w-5 h-5" />
    <span>Profile</span>
  </a>
  <a href="/settings" class="flex items-center gap-2">
    <CogOutline class="w-5 h-5" />
    <span>Settings</span>
  </a>
</nav>

Button with Icon:

---
import { PlusCircleSolid } from 'astrojs-heroicons';
---

<button class="flex items-center gap-2 px-4 py-2 bg-blue-500 text-white rounded-lg">
  <PlusCircleSolid class="w-5 h-5" />
  Add New Item
</button>

Status Indicators:

---
import { CheckCircleSolid, XCircleSolid, ExclamationCircleSolid } from 'astrojs-heroicons';
---

<div class="space-y-2">
  <div class="flex items-center gap-2 text-green-600">
    <CheckCircleSolid class="w-5 h-5" />
    <span>Success</span>
  </div>
  <div class="flex items-center gap-2 text-red-600">
    <XCircleSolid class="w-5 h-5" />
    <span>Error</span>
  </div>
  <div class="flex items-center gap-2 text-yellow-600">
    <ExclamationCircleSolid class="w-5 h-5" />
    <span>Warning</span>
  </div>
</div>

🎯 TypeScript Support

Enjoy full IntelliSense support when importing:

---
// Start typing and get autocomplete suggestions!
import { Home... } from 'astrojs-heroicons';
//             ^ HomeOutline, HomeSolid, HomeMini, HomeMicro
---

Each component includes JSDoc comments with icon metadata:

/** Heroicon: home (Outline variant) - Astro component */
export { default as HomeOutline } from "./HomeOutline.astro";

🎨 Icon Variants Comparison

---
import { HomeOutline, HomeSolid, HomeMini, HomeMicro } from 'astrojs-heroicons';
---

<div class="flex items-end gap-4">
  <HomeOutline class="w-6 h-6" />  <!-- 24×24 outline -->
  <HomeSolid class="w-6 h-6" />    <!-- 24×24 solid -->
  <HomeMini class="w-5 h-5" />     <!-- 20×20 solid -->
  <HomeMicro class="w-4 h-4" />    <!-- 16×16 solid -->
</div>

💡 Why This Package?

Existing Heroicons packages for Astro had limitations:

  • ❌ No centralized exports
  • ❌ Missing type definitions
  • ❌ No IntelliSense autocomplete
  • ❌ Cumbersome imports for large projects

This package solves all these issues:

  • ✅ Single import statement for any icon
  • ✅ Full TypeScript support with .d.ts files
  • ✅ IntelliSense shows all 1,200+ icons as you type
  • ✅ Clean, predictable naming convention
  • ✅ Native Astro components (no React/Vue wrappers)

📚 Finding Icons

Browse all available icons at the official Heroicons website: heroicons.com →

Naming Convention:

  • Website shows: academic-cap
  • Import as: AcademicCapOutline, AcademicCapSolid, AcademicCapMini, AcademicCapMicro

🤝 Contributing

Contributions are welcome! This package is automatically generated from the official Heroicons library.

📄 License

MIT © [Your Name]

🙏 Credits

All icons are from Heroicons by Tailwind Labs.

This package provides an Astro-friendly wrapper with enhanced developer experience.


Built with ❤️ for the Astro community