Socket
Book a DemoInstallSign in
Socket

rails_feather

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails_feather

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

rails_feather

Ruby on Rails views helper method for rendering beautiful feather icons. See all the icons here.

Installation

Add this line to your application's Gemfile:

gem "rails_feather"

And then execute:

bundle install

Or install it yourself as:

gem install rails_feather

Usage

After installing the gem, call <%= feather_icon "activity" %> on your erb template. The first argument is the icon name. All the icons are listed here.

This will generate the following html:

<svg
  version="1.1"
  width="24"
  height="24"
  viewBox="0 0 24 24"
  fill="none"
  stroke="currentColor"
  stroke-width="2"
  stroke-linecap="round"
  stroke-linejoin="round"
  aria-hidden="true"
>
  <polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline>
</svg>

Handling the size of the icon

Specify a size param in the helper method to set the height and width on the svg icon.

<%= feather_icon "activity", size: 20 %>

size defaults to 24 if not defined.

Handling the stroke-width of the icon

Specify a stroke_width param in the helper method to set the stroke-width on the svg icon.

<%= feather_icon "activity", stroke_width: 1 %>

stroke_width defaults to 2 if not defined.

HTML attributes

Any html and eruby attribute syntax is supported, for eg:

<%= feather_icon "activity", class: "custom-class", aria: { label: "User activity" } %>

Accessibility

rails_feather automatically sets aria-hidden="true" if aria-label is not set, and if aria-label is set, then role=img is set on the svg.

Development

  • Clone the repo
  • Run bundle install or ./bin/setup
  • Run rake to run the tests

Contributing

Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Please refer to CONTRIBUTING.md for further instructions.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the rails_feather project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 15 Mar 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.