{"id":15645182,"url":"https://github.com/abeidahmed/rails-heroicon","last_synced_at":"2025-04-09T12:04:02.348Z","repository":{"id":43222477,"uuid":"340903181","full_name":"abeidahmed/rails-heroicon","owner":"abeidahmed","description":"Ruby on Rails views helpers for the awesome heroicons by Steve Schoger.","archived":false,"fork":false,"pushed_at":"2024-08-23T15:35:21.000Z","size":1692,"stargazers_count":67,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T12:02:57.488Z","etag":null,"topics":["gem","heroicons","rails","ruby","svg-icons"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/rails_heroicon","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abeidahmed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-21T13:03:55.000Z","updated_at":"2025-03-24T03:35:48.000Z","dependencies_parsed_at":"2023-12-20T14:54:32.622Z","dependency_job_id":"bbd901ee-68ea-4cf8-ae2f-40641dad2f35","html_url":"https://github.com/abeidahmed/rails-heroicon","commit_stats":{"total_commits":140,"total_committers":4,"mean_commits":35.0,"dds":0.0357142857142857,"last_synced_commit":"430cb30a963b76a43dfa17003ff32f419a599a64"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Frails-heroicon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Frails-heroicon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Frails-heroicon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeidahmed%2Frails-heroicon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abeidahmed","download_url":"https://codeload.github.com/abeidahmed/rails-heroicon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036064,"owners_count":21037092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gem","heroicons","rails","ruby","svg-icons"],"created_at":"2024-10-03T12:04:59.692Z","updated_at":"2025-04-09T12:04:02.302Z","avatar_url":"https://github.com/abeidahmed.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rails Heroicon ![ci](https://github.com/abeidahmed/rails-heroicon/actions/workflows/ci.yml/badge.svg)\n\nRuby on Rails views helper for the awesome heroicons by Steve Schoger. To see\nall the icons visit [heroicons](https://heroicons.com/).\n\nThe latest version of this gem is built with heroicons\n[v2.1.5](https://github.com/tailwindlabs/heroicons/releases/tag/v2.1.5) (316 icons).\n\n\u003e This gem has no official affiliation with [Tailwind Labs](https://github.com/tailwindlabs),\n\u003e yet.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"rails_heroicon\"\n```\n\nAnd then execute:\n\n```bash\nbundle install\n```\n\nOr install it yourself as:\n\n```bash\ngem install rails_heroicon\n```\n\n## Usage\n\nAfter installing the gem, call `\u003c%= heroicon \"user\" %\u003e` on your `erb` template.\nThe first argument is the icon name. All the icons are listed [here](https://heroicons.com/).\n\nThis will generate the following html:\n\n```html\n\u003csvg\n  xmlns=\"http://www.w3.org/2000/svg\"\n  aria-hidden=\"true\"\n  width=\"24\"\n  height=\"24\"\n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"1.5\"\n  version=\"1.1\"\n\u003e\n  \u003cpath\n    d=\"M16 7C16 9.20914 14.2091 11 12 11C9.79086 11 8 9.20914 8 7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7Z\"\n    stroke-width=\"2\"\n    stroke-linecap=\"round\"\n    stroke-linejoin=\"round\"\n  /\u003e\n  \u003cpath\n    d=\"M12 14C8.13401 14 5 17.134 5 21H19C19 17.134 15.866 14 12 14Z\"\n    stroke-width=\"2\"\n    stroke-linecap=\"round\"\n    stroke-linejoin=\"round\"\n  /\u003e\n\u003c/svg\u003e\n```\n\n\u003e Note: Indentation is for readability purpose.\n\n### Variant\n\n`rails_heroicon` provides 4 variants, `outline`, `solid`, `mini`, and `micro`, `outline` being\nthe default.\n\nTo change the variant `\u003c%= heroicon \"user\", variant: \"solid\" %\u003e`.\n\n### HTML attributes\n\nAny `html` and `eruby` attribute is supported, for eg:\n\n```erb\n\u003c%= heroicon \"user\", class: \"text-gray-500\", aria: { label: \"user-icon\" } %\u003e\n```\n\n### Handling the size of the icon\n\nNormally, if you're just using vanilla heroicons with [Tailwind CSS](https://tailwindcss.com/),\nyou'd add `w-5 h-5` as classes on the svg element. With `rails_heroicon`, you just\nneed to set the `size` attribute on the helper method.\n\n```erb\n\u003c%= heroicon \"user\", size: 20 %\u003e\n```\n\nIf the `variant` is set as `outline` or `solid`, `size` defaults to `24`,\nif the `variant` is set as `mini`, `size` defaults to `20`, and if the `variant`\nis set as `micro`, `size` defaults to `16`. However, this can be over-written with\nthe `size` attribute.\n\n### Accessibility\n\n`rails_heroicon` automatically sets `aria-hidden=\"true\"` if `aria-label` is not\nset, and if `aria-label` is set, then `role=\"img\"` is set.\n\n### Tooltip\n\nYou can provide tooltips on hover if you pass in a `title` option. Anything\npassed into the `title` option will be rendered inside of a\n`\u003ctitle\u003e` tag within the rendered SVG, which modern browsers will lean on to\ndisplay a tooltip on hover.\n\n## Development\n\n- Clone the repo\n- Run `bundle install`, or run `./bin/setup`\n- Run `bundle exec rake` to run the tests to see if it passing\n\n## Publishing\n\n- `gem build rails_heroicon.gemspec`\n- `gem push rails_heroicon-x.x.x.gem`\n\n## Contributing\n\nBug reports and pull requests are welcome. This project is intended to be a\nsafe, welcoming space for collaboration, and contributors are expected to adhere\nto the [code of conduct](https://github.com/abeidahmed/rails-heroicon/blob/main/CODE_OF_CONDUCT.md).\n\nPlease read the [CONTRIBUTING.md](https://github.com/abeidahmed/rails-heroicon/blob/main/CONTRIBUTING.md)\non how to make pull requests.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Rails Heroicon project's codebases, issue trackers,\nchat rooms and mailing lists is expected to follow the\n[code of conduct](https://github.com/abeidahmed/rails-heroicon/blob/main/CODE_OF_CONDUCT.md).\n\n## Similar projects\n\n- [rails_feather](https://github.com/abeidahmed/rails_feather) - Ruby on Rails\n  views helper method for rendering beautiful feather icons.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeidahmed%2Frails-heroicon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabeidahmed%2Frails-heroicon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeidahmed%2Frails-heroicon/lists"}