unplugin-icons resolves Iconify icon sets as framework components in Vite, Webpack, Rollup, Nuxt, and more. Only icons you import are bundled, with custom and filesystem loaders supported.
Overview
unplugin-icons is a build plugin that turns icons from Iconify collections into components at compile time. Imports follow a ~icons/{collection}/{icon} convention and work across vanilla JS, web components, React, Vue, Solid, Svelte, and other supported compilers configured in the plugin.
Icon data can come from the full Iconify meta package, individual @iconify-json sets, or experimental auto-install when a collection is first referenced. Custom SVGs, external Iconify-shaped packages, and filesystem directories with hot reload are supported for local artwork alongside public sets.
The plugin targets on-demand bundling so production builds include only referenced glyphs, with SSR-friendly output and styling through normal CSS. Raw SVG imports are available by appending ?raw. Auto-import resolvers integrate with unplugin-vue-components and unplugin-auto-import for Vue and React-style prefixed components.
Configuration spans many bundlers—Vite, Rollup, Webpack, esbuild, Rspack, Nuxt, Next.js, SvelteKit, Astro, Ember, and others—with per-framework compiler options and TypeScript declaration hints.
Key features
- Iconify-backed on-demand icon imports
- Vite, Webpack, Rollup, and Nuxt plugins
- Custom SVG and filesystem collections
- Auto-import resolver integrations
- Raw SVG string import suffix
- iconCustomizer and query param tweaks
- Global default sizing and styling options
- TypeScript component declarations
Use cases
- Ship only used icons in SPA bundles
- Share icons across React and Vue codebases
- Load design-system SVGs from disk with HMR
- Auto-import icons in Vue templates
- Embed icons in SSR pages without FOUC