Class: StimulusPlumbers::Components::Icon
- Inherits:
-
Plumber::Base
- Object
- Plumber::Base
- StimulusPlumbers::Components::Icon
- Defined in:
- lib/stimulus_plumbers/components/icon.rb
Constant Summary
Constants included from Plumber::HtmlOptions
Plumber::HtmlOptions::STIMULUS_SPACEJOIN_KEYS
Instance Attribute Summary
Attributes inherited from Plumber::Base
Instance Method Summary collapse
Methods inherited from Plumber::Base
Methods included from Plumber::HtmlOptions
#extract_classes, #merge_data_options, #merge_html_options, #merge_string_option, #normalize_part
Constructor Details
This class inherits a constructor from StimulusPlumbers::Plumber::Base
Instance Method Details
#render(name:, **kwargs) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/stimulus_plumbers/components/icon.rb', line 6 def render(name:, **kwargs) = ( { classes: theme.resolve(:icon).fetch(:classes, "") }, kwargs ) icon_data = Themes::Schema::Icon.resolve(theme.icons[name]) if icon_data svg_icon(icon_data, ) else template.tag.span(**) end end |