Unplugin Icons screenshot

Unplugin Icons

Author Avatar Theme by Unplugin
Updated: 18 Feb 2025
4445 Stars

Access thousands of icons as components on-demand universally.

Categories

Overview

unplugin-icons is a npm package that allows users to access thousands of icons as components on-demand, making it easy to integrate icons into their projects. This package is universal, meaning it can be used with various frameworks and build tools. With support for major frameworks such as React, Vue, and Svelte, unplugin-icons offers flexibility and customizability for developers.

Features

  • Universal: Compatible with multiple frameworks.
  • Any icon sets: Access to over 150 popular icon sets with over 200,000 icons, logos, emojis, etc.
  • Major build tools: Works seamlessly with major build tools such as Vite, Webpack, Rollup, Nuxt, etc.
  • Major frameworks: Supports Vanilla, Web Components, React, Vue 3, Vue 2, Solid, Svelte, and more.
  • On-demand: Bundles only the icons you actually use, saving on resources.
  • SSR / SSG friendly: Icons can be shipped with the page, reducing FOUC (Flash of Unstyled Content).
  • Stylable: Easily change size, color, and add animations using styles and classes.
  • Custom icons: Load your own custom icons for universal integration.
  • Auto Importing: Use icons as components directly in your template.
  • TypeScript support: Fully compatible with TypeScript.

Installation

To install unplugin-icons, follow these steps:

  1. Install the package using your preferred package manager:

    npm install unplugin-icons
    

    or

    yarn add unplugin-icons
    
  2. Import the icons using the convention ~icons/{collection}/{icon}. For example:

    import { mdiAccount } from "~icons/mdi/mdi-account";
    

    The icons can then be used directly as components in your project.

  3. Optionally, you can install the full collection of icons by installing the @iconify/json package:

    npm install @iconify/json
    

    This will allow you to use any icon from the entire collection.

Summary

Overall, unplugin-icons is a powerful npm package that provides easy access to thousands of icons as components. With support for multiple frameworks and build tools, it offers flexibility and convenience for developers. By allowing on-demand bundling of icons and providing customizability options, unplugin-icons enhances productivity and improves the user experience of icon integration in projects.