Transform SVG icons into beautiful React, React Native, Vue, or Svelte components with zero config.
mkicon initindex.ts for clean importspnpm add -g @steellgold/mkicon
# or
npm install -g @steellgold/mkicon
# Initialize with sensible defaults
mkicon init
# Then create an icon (interactive)
mkicon
# Or directly
mkicon -n UserPlus -p '<svg>...</svg>'
| Command | Description |
|---|---|
mkicon |
Interactive mode |
mkicon init |
Initialize config with defaults |
mkicon paste / url / file |
Semi-interactive (skip source selection) |
mkicon batch <dir> |
Convert a folder of SVGs |
mkicon batch --refresh |
Rebuild lock file after a fresh clone |
mkicon diff |
Detect & revert component drift |
mkicon preview [name] |
Render an icon in the terminal |
mkicon svg <file> |
Export a component back to SVG |
mkicon library / browse |
Browse Lucide icon library |
mkicon spinner / spin |
Generate an animated spinner |
mkicon config |
Manage configuration |
mkicon inspect-config |
Show detected project formatting |
For detailed usage, flags, and examples see the documentation.
mkicon stores its config in .mkicon.json at your project root (commit it!):
{
"$schema": "https://unpkg.com/@steellgold/mkicon/schema.json",
"version": "1.0.0",
"baseDir": "src/components",
"iconsFolder": "icons",
"framework": "react",
"typescript": true,
"optimize": true,
"maintainIndex": true,
"adaptToProject": true,
"props": { "size": true, "color": true, "className": true },
"naming": { "suffix": "Icon", "suffixEnabled": true, "componentCase": "PascalCase", "fileCase": "PascalCase" }
}
See the configuration reference for all options.
Contributions are welcome — open a PR or report an issue.
MIT © Gaëtan H