Access thousands of icons as components on-demand universally.
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.
To install unplugin-icons, follow these steps:
Install the package using your preferred package manager:
npm install unplugin-icons
or
yarn add unplugin-icons
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.
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.
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.