Class: OkonomiUiKit::Components::Icon
- Inherits:
-
OkonomiUiKit::Component
- Object
- OkonomiUiKit::Component
- OkonomiUiKit::Components::Icon
- Defined in:
- app/helpers/okonomi_ui_kit/components/icon.rb
Instance Attribute Summary
Attributes inherited from OkonomiUiKit::Component
Instance Method Summary collapse
Methods inherited from OkonomiUiKit::Component
#combined_styles, config_class?, config_class_name, config_classes, config_namespace, #config_styles_registry, config_styles_registry, deep_merge, #initialize, #internal_styles_registry, internal_styles_registry, #name, parent_styles_registry, register_styles, resolve_config_classes, #style, #styles, #template_path, #theme_name, #tw_merge, #variant_style
Constructor Details
This class inherits a constructor from OkonomiUiKit::Component
Instance Method Details
#render(name, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/okonomi_ui_kit/components/icon.rb', line 4 def render(name, = {}) = .with_indifferent_access # Extract specific icon options variant = .delete(:variant) || :outlined width = .delete(:width) height = .delete(:height) # Build classes array classes = [ style(:base), .delete(:class) ].compact.join(" ") view.render( template_path, name: name, variant: variant, width: width, height: height, classes: classes, options: ) end |