Skip to content

v2.0.0

Choose a tag to compare

@narciero narciero released this 03 Dec 23:04
· 2 commits to main since this release

You can now configure default attributes on a per variant basis.

# config/initializers/heroicons.rb
Heroicons.configure do |config|
  config.attributes[:mini] = { class: "h-4 w-4" }
end

Usage

The following render using the default class="h-4 w-4"

<%= heroicon "check", variant: :mini %>

If you specify an attribute (eg. class) manually, that will overwrite the default completely, so the following will only render class="text-gray-500"

<%= heroicon "check", variant: :mini, class: "text-gray-500" %>