Class: StimulusPlumbers::Components::Icon::Renderer
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Icon::Renderer
- Defined in:
- lib/stimulus_plumbers/components/icon/renderer.rb
Constant Summary collapse
- ICONS =
{ "arrow-left" => "M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18", "arrow-right" => "M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3", "arrow-up" => "M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18", "arrow-down" => "M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3" }.freeze
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::HtmlOptions
#merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Components::Plumber::Base
Instance Method Details
#icon(name:, **kwargs) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/stimulus_plumbers/components/icon/renderer.rb', line 14 def icon(name:, **kwargs) = ( { classes: theme.resolve(:icon).fetch(:classes, "") }, kwargs ) if ICONS[name] svg_icon(ICONS[name], ) else template.content_tag(:span, nil, **) end end |