A Rails integration for Heroicons - Beautiful hand-crafted SVG icons by the makers of Tailwind CSS.
Heroicons Version: v2.1.5
After installation, helper methods are automatically available in your views:
<%= icon_tag "x-mark" %>
<%= icon_tag "x-mark", class: "bg-red-500" %>
<%= icon_tag "x-mark", type: :mini, class: "bg-red-500" %>
<%= icon_tag "academic-cap", type: :solid, class: "w-8 h-8" %>
Available icon types:
:outline
(default) - 24x24 outline icons:solid
- 24x24 solid icons:mini
- 20x20 solid icons:micro
- 16x16 solid icons:custom
- Custom icons (place inapp/assets/images/icons/custom/
)
You can add your own custom icons by creating the directory structure and using the :custom
type:
app/assets/images/icons/custom/
├── my-logo.svg
├── custom-arrow.svg
└── company-icon.svg
<%= icon_tag "my-logo", type: :custom %>
<%= icon_tag "custom-arrow", type: :custom, class: "w-4 h-4" %>
Add this line to your application's Gemfile:
gem "heroicons-rails", github: "lab2023/heroicons-rails", branch: "main"
And then execute:
$ bundle
Once you've made your great commits:
- Fork Template
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Create a Pull Request from your branch
- That's it!
- heroicons-rails is maintained and funded by lab2023 - information technologies
- Thank you to all the contributors!
- This gem uses Heroicons
- The names and logos for lab2023 are trademarks of lab2023, inc.
The gem is available as open source under the terms of the MIT License. Copyright © 2013-2024 lab2023 - information technologies