Everyone, say “hi” again to Rails Icons 👋
Late 2024 I published Rails Icons 1.0 (slighly off-topic, but I mentioned a modest few thousand downloads in that article; now it is close to 250k; I expect the same + a bit more for Perron). Today I like to re-introduce Rails Icons again to you: here is version 1.8.
(I did not expect SVG icons could be this exciting; and I have a few more ideas still! 🤯)
First I extracted the sync and SVG creation logic (the bit people have copy-pasted instead of using/contributing to the gem) into its own gem: Icons, I wrote about it here. The main goal was to make the “behind-the-scenes” architecture (syncing, normalizing icon names, etc.) available for others to build a similar gem for their framework of choice like Hanami, Roda and so on. That logic is novel and could be used in any kind of Ruby app. This keeps the Rails Icons even more light-weight and allows me to add features I want to share with you today.
Like (experimental) support for Ruby LSP.
![]()
This allows you to write icon "|" in your IDE and it will show a completion dialog for all synced icon names. This works also with variant and library name. It is still early stage and would love some help from you if you are experienced with Ruby LSP. 🙏
Then a feature I have had on my list for well over a year: a preview of all your icons 😻
Simply add mount RailsIcons::Engine => "rails_cons" to your routes and you are presented with this lovely view:
![]()
Here you can:
- search by icon name and by related keyword (added small mappings for all Rails Icons’ supported libraries, hence you can search for
nature,vehicleandtravel😊) - copy name
- copy helper (so for above screenshot it copies:
icon('bulldozer'), and it will add the variant if that one is not your configured default variant 💡) - query is stored in url so it shareable with your team (of LLM bots 😭)
I think this is pretty cool! 😎
I thought these twothree big features were well worth a re-introduction. If you haven’t checked it out, it is here on GitHub. Be sure to star ⭐ it! ✌️
If you are already using Rails Icons, be sure to add your project to the list. Downloads and stars are nice and all for the larger community, usage in real projects are a true motivator for the maintainer (i.e. me).
Want to read me more?
-
Introducing Icons: Add any icon library to your Ruby app
Icons is a new gem to add any icon library to your Ruby apps. -
Free Icon Libraries for Rails Apps
A list of the most popular, free icon libraries you can use in your Ruby on Rails app. -
Rails Icons 1.0.0 is here
You don't need JavaScript for many modern UI components. The accordion is a classic example. Let's explore how it's done.
Over to you…
What did you like about this article? Learned something knew? Found something is missing or even broken? 🫣 Let me (and others) know!
Comments are powered by Chirp Form
{{comment}}