Class: NitroKit::Icon
- Defined in:
- app/components/nitro_kit/icon.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Attributes inherited from Component
Instance Method Summary collapse
-
#initialize(name, size: :md, **attrs) ⇒ Icon
constructor
A new instance of Icon.
- #view_template ⇒ Object
Methods inherited from Component
Constructor Details
#initialize(name, size: :md, **attrs) ⇒ Icon
Returns a new instance of Icon.
7 8 9 10 11 12 13 14 15 16 |
# File 'app/components/nitro_kit/icon.rb', line 7 def initialize(name, size: :md, **attrs) @name = name @size = size super( attrs, class: size_class, stroke_width: 1.5 ) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'app/components/nitro_kit/icon.rb', line 18 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
18 19 20 |
# File 'app/components/nitro_kit/icon.rb', line 18 def size @size end |
Instance Method Details
#view_template ⇒ Object
20 21 22 |
# File 'app/components/nitro_kit/icon.rb', line 20 def view_template lucide_icon(name, **dasherized_attrs) end |