iconmate Svelte Themes

Iconmate

๐Ÿ’š Easier way to add icons to your (React,Solid,Svelte,Vue) app without any dependencies.

iconmate ๐Ÿ’š

Your new favorite way to manage icons for your Vite, NextJS projects without icon libraries!

Based on my blog post on Why you might not need an icon library. Built with ๐Ÿฆ€ Rust, โšก๏ธ designed for speed, ๐Ÿฆ… made for developers who hate icon library bloat.

Stop installing bloated icon libraries. All you need is icones.js.org or your designer's Figma icon pack and paste them into your project with surgical precision.

What Makes It Special โœจ

  • Zero Dependencies ๐Ÿ“ฆ: Just a CLI, No icon libraries to bundle
  • Framework Native ๐Ÿงฉ: Works with React, Vue, Svelte, Solid - generates components automatically
  • Interactive Mode ๐ŸŽฎ: Just run iconmate and let it guide you
  • URL Support ๐ŸŒ: Fetch from any SVG URL, not just iconify
  • Raw SVG ๐Ÿ“‹: Copy-paste SVG code directly
  • Empty SVG ๐Ÿ—๏ธ: Create placeholder icons for rapid prototyping

Quick Start

# Install
npm install -g iconmate

# Run inside your project ๐Ÿš€
iconmate

> ๐Ÿ“ Folder (src/assets/icons/) # Enter
> โœจ Preset # Choose react
> ๐Ÿš€ Icon # heroicons:heart
> ๐Ÿ’Ž Name # Heart

โœจ That's it. The interactive CLI guides you through adding icon 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:

iconmate --folder src/components/Icons/ --folder src/components/icons
iconmate --folder src/components/Icons/ --icon heroicons:heart --name Heart

Installation

NPM ๐Ÿฆ–

npm install -g iconmate
# or
pnpm add -g iconmate
# or
bun add -g iconmate

For one-off usage:

npx iconmate
# or
pnpm dlx iconmate
# or
bunx iconmate

[!NOTE] Note for Bun users: Bun doesn't run postinstall scripts by default which is needed to install the iconmate binary. Add "trustedDependencies": ["iconmate"] to your package.json to do it! But you're only limited to running it with a package.json.

Recommended: Just use pnpx for quick one-off usage. If in a project, either install globally or configure trustDependencies.

Install from Cargo ๐Ÿฆ€

cargo install iconmate

Or clone and install from source:

git clone https://github.com/blankeos/iconmate.git
cd iconmate
cargo install --path .

Framework Presets

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 .svg file types, make sure to setup svgr. I covered how to do this in:

Command Line

iconmate

# Description of each prompt:
> ๐Ÿ“ Folder (src/assets/icons/) # where your icons will be saved.

> โœจ Preset # i.e. How will it be saved? An `.svg` or `.tsx` file in react, solid, etc.

> ๐Ÿš€ Icon # Source of your icon. i.e. 'heroicons:heart' from https://icones.js.org, full URL, or any SVG. Can be empty except for 'emptysvg' preset.

> ๐ŸŒ„ Filename # The filename without the extension. i.e. heroicons:heart. Will only be prompted if you used an SVG, or an URL on icon.

> ๐Ÿ’Ž Name # The "Heart" in <IconHeart />

Add Specific Icon

iconmate add --folder src/assets/icons --icon heroicons:heart --name Heart

With URL

iconmate add --folder src/assets/icons --icon https://api.iconify.design/mdi:heart.svg --name Heart

Raw SVG Content

iconmate add --folder src/assets/icons --icon '<svg>...</svg>' --name Heart

Custom Export Template

iconmate add --folder src/assets/icons --icon heroicons:heart --name Heart --output-line-template "export { ReactComponent as Icon%name% } from './%icon%.svg?react';"

Delete icons

iconmate delete --folder src/assets/icons

Package.json Scripts

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/"

  // Usage: npm run iconmate-react
  "iconmate-react": "iconmate --folder ./src/assets/icons/ --preset react",

  // Usage: npm run iconmate-empty
  "iconmate-empty": "iconmate --folder ./src/assets/icons/ --preset emptysvg",
}

Supported Platforms

  • macOS (Intel & Apple Silicon) ๐ŸŽ
  • Linux (x64 & ARM64) ๐Ÿง
  • Windows (x64) ๐ŸชŸ

How It Works

  1. Find your icon: Visit https://icones.js.org.
  2. Copy the name: Like heroicons:heart.
  3. Run iconmate: iconmate

Why this structure?

  1. Copy-paste workflow: Find icon on icones.js.org โ†’ copy name โ†’ paste into iconmate
  2. Organized by default: Everything goes into index.ts exports automatically and just typing <Icon will autosuggest from your current collection. Just regular TS behavior.
  3. TypeScript ready: Generated code is fully typed. Pass custom width, height, fills, you name it.
  4. Customizable ๐ŸŽจ: Want to add a default Tailwind class on every icon? custom props? Just add it to the file!
  5. Git-friendly: Plain SVG files, no binary assets
  6. Lightning fast: Native Rust binary, no Node.js startup time

Contributing

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 โญ

What's Completed from the Roadmap

  • โœ… Interactive prompt mode
  • โœ… Framework presets (React, Vue, Svelte, Solid)
  • โœ… URL and raw SVG support
  • โœ… Custom export templates
  • โœ… Zero-config installation

Original Future Plans

  • An empty command. Creates an .svg, adds it to the index.ts with a name you can specify.
  • Paste an actual svg instead of an icon name.
  • Just a --preset=svg,react,solid,svelte,vue - which basically overrides templates. Default is svg.
  • Prompt Mode via iconmate - Interactive mode so you won't need to pass arguments.
  • Delete an icon using iconmate delete
  • Other frameworks i.e. --preset=flutter or Go/Rust GUI apps? (Not sure how they work yet though).
  • Zed or VSCode Extension (seems unnecessary now, it's just a CLI)

Made with Rust ๐Ÿฆ€ | Based on my blog post

Top categories

Loading Svelte Themes