rdicons CLI Available
Search icons and drop them into any project as SVG, JSX or TSX. No framework needed.
Try it
npx rdicons add lucide:houseThat writes icons/lucide-house.svg. Needs Node 18 or newer.
Commands
rdicons add <set:name> [more...] download icons into a folder
rdicons search <query> [--set s] find icons by name
rdicons info <set:name> show the code for one icon (every install option)
rdicons migrate <path> --to <set> switch a project's icon imports to another library
rdicons audit <path> which icon libraries a project uses
rdicons sets list the 19 libraries and their licensesExamples
# React components, recolored, into src/icons
npx rdicons add tabler:bell ph:heart --format tsx --out src/icons --color "#4f46e5" --size 20
# find an icon, then add it
npx rdicons search "arrow right" --set lucide
npx rdicons add lucide:arrow-rightOptions for add
| Option | Default | |
|---|---|---|
--format | svg | svg, jsx or tsx |
--out | ./icons | Folder to write into (created if missing) |
--color | currentColor | Any CSS color |
--size | 24 | Width and height in px |
--stroke | icon's own | Stroke width for outline icons |
--padding | 0 | Extra space around the icon |
--background | none | Solid background color |
--animated [mode] | off | Add the icon's animation (rd icons): hover (default), parent, play or loop. The CSS is inside the file. |
--speed <n> | 1 | Animation speed, 2 is twice as fast (needs --animated) |
--duotone [n] | off | Fill the closed shapes of outline icons with a soft second tone (strength 0.05 to 0.6, default 0.2) |
--gradient from,to[,angle] | off | The line runs from one color to another, for example "#ec4899,#4f46e5,45" |
Switch icon library
Moving a project from one icon library to another usually means editing every import by hand. migrate does it for you. It shows a preview first and changes nothing until you add --write, so commit your work before you apply it.
npx rdicons migrate src --to tabler # preview
npx rdicons migrate src --to rd --write # applyIt reads the imports of lucide-react, @tabler/icons-react, @phosphor-icons/react, @heroicons/react and react-icons, and points them at @rdicons/react/<library> (@rdicons/vue/<library> for Vue). Icons are matched by name and by common alternative names (home and house), and the names you use in your JSX stay the same. Icons with no match stay on the old import and are listed, so the project keeps building. Tabler's stroke prop becomes strokeWidth.
See what a project uses
audit reads your source and reports which icon libraries it imports from, how many icons each supplies, icons used from two libraries at once (house and home), each library's license (and who you must credit), and which icons rd also has. It never changes files. Add --strict to fail a CI job when libraries are mixed, an icon is duplicated, or credit is required; --json prints the data.
npx rdicons audit src
npx rdicons audit src --strict # exit 1 when something needs attentionTo run it on every pull request, use the GitHub Action:
- uses: actions/checkout@v4
- uses: DevHydeOut/rdicons-lib@main
with:
path: srcNotes
- Icons are fetched from this website, so you need an internet connection. Set
RDICONS_URLto use another address. - Icons keep their own license. Run
rdicons setsto see them, and read Icon licenses. - On npm: rdicons.