Class: Panda::Core::Admin::HeadingComponent
- Defined in:
- app/components/panda/core/admin/heading_component.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text: "", icon: "", meta: nil, level: 2, additional_styles: nil, **attrs) {|_self| ... } ⇒ HeadingComponent
constructor
A new instance of HeadingComponent.
Constructor Details
#initialize(text: "", icon: "", meta: nil, level: 2, additional_styles: nil, **attrs) {|_self| ... } ⇒ HeadingComponent
Returns a new instance of HeadingComponent.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/components/panda/core/admin/heading_component.rb', line 10 def initialize(text: "", icon: "", meta: nil, level: 2, additional_styles: nil, **attrs, &block) @text = text @icon = icon @meta = @level = level @additional_styles = additional_styles super(**attrs) # Execute block if passed to new() directly (for tests/direct instantiation) # This allows: HeadingComponent.new(text: "Pages") { |h| h.with_button(...) } # Note: When used via render() with a block, ViewComponent handles the block separately yield self if block_given? end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
23 24 25 |
# File 'app/components/panda/core/admin/heading_component.rb', line 23 def icon @icon end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
23 24 25 |
# File 'app/components/panda/core/admin/heading_component.rb', line 23 def level @level end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
23 24 25 |
# File 'app/components/panda/core/admin/heading_component.rb', line 23 def @meta end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
23 24 25 |
# File 'app/components/panda/core/admin/heading_component.rb', line 23 def text @text end |