Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Add any icon library to a Rails app. Rails Icons has first-party support for a handful of libraries. It is library agnostic so it can be used with any icon library using the same interface.
# Using the default icon library
<%= icon "check", class: "text-gray-500" %>
# Using any custom library
<%= icon "apple", library: "simple_icons", class: "text-black" %>
The icons are sourced directly from their respective GitHub repositories, ensuring Rails Icons remain lightweight.
Sponsored By Rails Designer
Add the gem
bundle add rails_icons
Install, choosing one of the supported libraries
rails generate rails_icons:install --libraries=LIBRARY_NAME
Example
rails generate rails_icons:install --libraries=heroicons
Or multiple at once
rails generate rails_icons:install --libraries=heroicons lucide
# Uses the default library and variant defined in config/initializer/rails_icons.rb
icon "check"
# Use another variant
icon "check", variant: "solid"
# Set library explictly
icon "check", library: "heroicons"
# Add CSS
icon "check", class: "text-green-500"
# Add data attributes
icon "check", data: { controller: "swap" }
# Set the stroke-width
icon "check", stroke_width: 2
Rails Icons also includes a few animated icons. Great for loading states and so on. These are currently included:
faded-spinner
trailing-spinner
fading-dots
bouncing-dots
Use like this: icon "faded-spinner", library: "animated"
. The same attributes as other libraries are available.
Need to use an icon from another library?
rails generate rails_icons:initializer --custom=simple_icons
;Every custom icon can now be used with the same interface as first-party icon libraries.
icon "apple", library: "simple_icons", class: "text-black"
If a library gets updated, sync the icons to your app by running
rails generate rails_icons:sync --libraries=LIBRARY_NAME
Example
rails generate rails_icons:sync --libraries=heroicons
# Or multiple at once:
rails generate rails_icons:sync --libraries=heroicons lucide
This project uses Standard for formatting Ruby code. Please make sure to run be standardrb
before submitting pull requests. Run tests via rails test
.
Rails Icons is released under the MIT License.
FAQs
Unknown package
We found that rails_icons demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.