Icons

The icons component from Instrumental Components provides an easy way to implement hundreds of icons into your Rails application using a simple helper method.

It wraps the Lucide icon set and provides a simple helper method with customization options built in.

Installation

Copy
rails g instrumental:icons

To insert a component into a view:

Copy
rails g instrumental:icons:insert

Usage

Insert an icon into a view using this helper method:

Copy
<%= icon("rocket") %>

Customization

Find all of the options for the icon helper method in this file:
app/helpers/icons_helper.rb

The customization options include:

  • The icon name (use any icon listed on the Lucide website)
  • The size of the icon
  • The stroke width of the icon
  • CSS classes to apply color, responsive sizing and other customizations
Instrumental Components

I created Instrumental Components to make designing and building professional apps with Ruby on Rails easy, fast, and fun. I use it on all of my projects and I hope it helps you build something great.

Brian Casel
Brian Casel
Creator of Instrumental Components
Learn more Send me a question or request