Add SVG icons to your JS apps without icon libraries.
Quick Start · Install · Presets · CLI Commands · AI Ready · Configuration
Built from my blog post on Why you might not need an icon library, iconmate is a Rust-powered CLI for developers who want the speed and control of plain files without icon-package bloat.
Use icones.js.org, a direct SVG URL, or raw SVG markup. iconmate drops the icon straight into your project and keeps your exports tidy.
iconmate --help and it should be able to get everything running!iconmate and have a pleasant interactive TUI# Install
npm install -g iconmate
# Run the TUI in your project 🚀
iconmate
✨ That's it. The interactive TUI guides you through adding icons to your project.
// 👇 Then, you can just easily use any icon on your project like this!
import { IconHeart } from "@/assets/icons";
function MyApp() {
return <IconHeart />;
}
You can also add sensible defaults by passing flags as configs:
iconmate --folder src/components/Icons/ --folder src/components/icons
iconmate --folder src/components/Icons/ --icon heroicons:heart --name Heart
Iconmate now includes config schemas + TS type definitions in the repo:
iconmatelocal.schema.jsoniconmateglobal.schema.jsonhttps://raw.githubusercontent.com/Blankeos/iconmate/main/iconmatelocal.schema.jsonhttps://raw.githubusercontent.com/Blankeos/iconmate/main/iconmateglobal.schema.jsonconfig-gen/src/schema.tsconfig-gen/src/types.tsRegenerate schemas from project root:
just config-schema
just config-schema installs config-gen deps and generates both schema files.
iconmate.config.json){
"$schema": "https://raw.githubusercontent.com/Blankeos/iconmate/main/iconmatelocal.schema.json",
"folder": "src/assets/icons",
"preset": "normal",
"output_line_template": "export { default as Icon%name% } from './%icon%%ext%';",
"svg_view_cmd": "zed %filename%"
}
Use the raw URL for $schema so editors can fetch JSON directly.
Local config keys:
folder (default: src/assets/icons)preset (default: normal, meaning plain .svg mode)output_line_template (default: export { default as Icon%name% } from './%icon%%ext%';)svg_view_cmd (supports %filename% token)Allowed preset values:
normal (plain SVG mode)reactsveltesolidvueemptysvgGlobal config is for user-wide defaults and currently documents svg_view_cmd.
Suggested paths:
~/Library/Application Support/iconmate/config.json~/.config/iconmate/config.json%APPDATA%\\iconmate\\config.jsonExample global config:
{
"$schema": "https://raw.githubusercontent.com/Blankeos/iconmate/main/iconmatelocal.schema.json",
"svg_view_cmd": "code %filename%"
}
[!NOTE] This release adds config schemas and generated docs/types. Runtime loading/precedence wiring in the CLI/TUI is tracked in
folder-system-plan.md.
# Install globally with either:
npm install -g iconmate
pnpm add -g iconmate
bun add -g iconmate
# Use without installing with either:
npx iconmate
pnpm dlx iconmate
bunx iconmate
cargo install iconmate
# Or clone and install from source:
git clone https://github.com/blankeos/iconmate.git
cd iconmate
cargo install --path .
Determines the output filetype and the contents inside that file type.
| Preset | File Type | Framework |
|---|---|---|
normal |
.svg |
Vanilla HTML/CSS |
react |
.tsx |
React Components |
svelte |
.svelte |
Svelte Components |
solid |
.tsx |
Solid Components |
vue |
.vue |
Vue Components |
emptysvg |
.svg |
Placeholder |
[!IMPORTANT] If you want to use
.svgfile types, make sure to setup svgr for your js apps. I covered how to do this in:
- SolidJS (Vite)
- React (Vite)
- React (NextJS)
- Vue - contribution welcome!
- Svelte - couldn't find an svgr integration. Just use the svg preset.
iconmate
This section is helpful for AI:
iconmate add --folder src/assets/icons --icon heroicons:heart --name Heart
iconmate add --folder src/assets/icons --icon https://api.iconify.design/mdi:heart.svg --name Heart
iconmate add --folder src/assets/icons --icon '<svg>...</svg>' --name Heart
You can also pull raw SVG directly from the Iconify API:
iconmate add --folder src/assets/icons --icon "$(curl -fsSL https://api.iconify.design/mdi:heart.svg)" --name Heart
iconmate add --folder src/assets/icons --icon heroicons:heart --name Heart --output-line-template "export { ReactComponent as Icon%name% } from './%icon%.svg?react';"
iconmate delete --folder src/assets/icons
# Search by keyword (text: one prefix:icon per line)
iconmate iconify search heart
# Search with pagination and JSON output
iconmate iconify search heart --limit 20 --start 0 --format json
# Include collection metadata in JSON search output
iconmate iconify search heart --format json --include-collections
# List all available collections
iconmate iconify collections
# List icons from one collection prefix
iconmate iconify collection mdi
# Get one icon as raw SVG (default)
iconmate iconify get mdi:heart
# Get one icon as raw Iconify JSON
iconmate iconify get mdi:heart --format json
iconmate iconify get <prefix:icon> --format json uses Iconify's JSON endpoint format,
for example https://api.iconify.design/mdi.json?icons=heart.
iconmate is designed to be easy for AI agents and scripts to drive end-to-end.
# 1) Search in machine-readable JSON
iconmate iconify search heart --format json --limit 20 --include-collections
# 2) Add an icon non-interactively from prefix:name
iconmate add --folder src/assets/icons --icon mdi:heart --name Heart
# 3) Or fetch raw SVG from Iconify API and add directly
iconmate add --folder src/assets/icons --icon "$(curl -fsSL https://api.iconify.design/mdi:heart.svg)" --name Heart
This means an AI can search, choose, and add icons without opening a browser.
Best practice: Add sensible defaults to your script runner.
"scripts": {
// Usage: npm run iconmate (usually this is the only command you need)!
"iconmate": "iconmate --folder src/assets/icons/"
}
iconmate iconify search <query>.heroicons:heart.iconmate) or direct (iconmate add ...).index.ts exports automatically and just typing <Icon will autosuggest from your current collection. Just regular TS behavior.Contributions are welcome—pull requests for bug fixes, new framework presets, or improvements are appreciated.
🐱 Repo: github.com/Blankeos/iconmate - Star it if you love it ⭐
name.normal, react, solid, svelte, vue, emptysvg) override output templates and file types.iconmate - Interactive mode so you won't need to pass arguments.iconmate deleteiconmate iconify --help commands for AI to easily look for icons itself.Made with Rust 🦀 | Based on my blog post