rdicons CLI Available

Search icons and drop them into any project as SVG, JSX or TSX. No framework needed.

Try it

terminal
npx rdicons add lucide:house

That writes icons/lucide-house.svg. Needs Node 18 or newer.

Commands

terminal
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 licenses

Examples

terminal
# 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-right

Options for add

OptionDefault
--formatsvgsvg, jsx or tsx
--out./iconsFolder to write into (created if missing)
--colorcurrentColorAny CSS color
--size24Width and height in px
--strokeicon's ownStroke width for outline icons
--padding0Extra space around the icon
--backgroundnoneSolid background color
--animated [mode]offAdd the icon's animation (rd icons): hover (default), parent, play or loop. The CSS is inside the file.
--speed <n>1Animation speed, 2 is twice as fast (needs --animated)
--duotone [n]offFill the closed shapes of outline icons with a soft second tone (strength 0.05 to 0.6, default 0.2)
--gradient from,to[,angle]offThe 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.

terminal
npx rdicons migrate src --to tabler          # preview
npx rdicons migrate src --to rd --write      # apply

It 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.

terminal
npx rdicons audit src
npx rdicons audit src --strict    # exit 1 when something needs attention

To run it on every pull request, use the GitHub Action:

.github/workflows/icons.yml
- uses: actions/checkout@v4
- uses: DevHydeOut/rdicons-lib@main
  with:
    path: src

Notes

  • Icons are fetched from this website, so you need an internet connection. Set RDICONS_URL to use another address.
  • Icons keep their own license. Run rdicons sets to see them, and read Icon licenses.
  • On npm: rdicons.