A pure ruby wrapper around your favourite icon libraries.
$ gem install iconic
Use the following whenever you want an icon...
Iconic.icon 'ban'Or with options...
Iconic.icon 'bookmark-alt', { theme: 'heroicons', style: 'outline', width: 1, title: 'This is an icon' }or create a helper method with custom default...
def icon(name, options = {})
# custom default options
options = options.dup
options.fetch(:theme, 'bootstrap')
options.fetch(:class, 'icon')
options.fetch(:size, 18)
raw(Iconic.icon(name, options))
endDefaults
theme: 'heroicons' # Icon set name
style: 'outline' # Icon subset name (only applicable to Heroicons)
size: 24 # Size. 24px
width: 2 # Stroke width
title: # Title attribute (no default)
class: # Class name (no default)
Themes (icon sets)
- heroicons
- bootstrap
- hugeicons
- heroicons
- lucide
- octicons
- tabler
- untitled-ui