Icon library for Uniweb - lazily loaded SVG icons from popular icon sets
npm install @uniweb/iconsIcon library for Uniweb sites. Provides lazily loaded SVG icons from popular icon sets.
- Local resolution: Faster than CDN for included icon families
- Tree-shakeable: Import only the icons you use
- CDN fallback: Automatically falls back to GitHub Pages CDN
- Permissive licenses: All included icons use MIT, ISC, or similar licenses
``bash`
pnpm add @uniweb/icons
Icons are automatically available when using  syntax in markdown. The runtime fetches icons from the CDN by default.
For local resolution (faster, offline-capable), configure the runtime:
`js
import { createLocalResolver } from '@uniweb/icons/resolver'
// In your site's initialization
uniweb.iconResolver = createLocalResolver()
`
For maximum tree-shaking, import icons directly:
`js`
import homeSvg from '@uniweb/icons/families/lu/home.js'
// homeSvg is the SVG string: ''
These families are included in the npm package for local resolution:
| Family | Code | Icons | License |
|--------|------|-------|---------|
| Lucide | lu | 1,541 | ISC |hi
| Heroicons v1 | | 460 | MIT |hi2
| Heroicons v2 | | 972 | MIT |fi
| Feather | | 287 | MIT |
These families are available via CDN but not included in the npm package (to reduce size):
| Family | Code | License | Notes |
|--------|------|---------|-------|
| Phosphor | pi | MIT | Large set (9k+ icons) |tb
| Tabler | | MIT | Large set (5k+ icons) |bs
| Bootstrap | | MIT | |md
| Material Design | | Apache-2.0 | |ai
| Ant Design | | MIT | |ri
| Remix | | Apache-2.0 | |si
| Simple Icons | | CC0-1.0 | Brand logos |
Icons are served from GitHub Pages:
``
https://uniweb.github.io/icons/{family}/{family}-{name}.svg
Example: lucide:home → https://uniweb.github.io/icons/lu/lu-home.svg
To use a different CDN:
`yaml`site.yml
icons:
cdnUrl: https://your-cdn.com/icons
This package redistributes icons from upstream projects. Each icon family retains its original license:
- ISC: Lucide (see licenses/lucide.md)
- MIT: Heroicons, Feather (see licenses/)
All included families use permissive licenses (MIT, ISC, Apache-2.0, CC0) that allow redistribution with attribution. See the licenses/ directory for full license texts.
Note: Some icon families available via CDN (Font Awesome, VS Code Icons, Game Icons) use CC BY licenses that require attribution. If you use these families, ensure proper attribution in your project.
`bash`
pnpm install
pnpm convert # Default families
pnpm convert:all # All families
`bash``
node scripts/build-cdn.js # Build SVG files for CDN deployment
The GitHub Actions workflow automatically builds and deploys to GitHub Pages on tagged releases.
This package's code is MIT licensed. Icon assets retain their original licenses (see above).