Class: Panda::Core::Admin::DropdownButtonComponent
- Defined in:
- app/components/panda/core/admin/dropdown_button_component.rb
Overview
A button-styled dropdown menu. Combines ButtonComponent styling with
DropdownComponent behaviour (Stimulus dropdown controller).
Defined Under Namespace
Classes: ItemComponent
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text: "Options", action: :secondary, icon: nil, size: :regular, **attrs) {|_self| ... } ⇒ DropdownButtonComponent
constructor
A new instance of DropdownButtonComponent.
Constructor Details
#initialize(text: "Options", action: :secondary, icon: nil, size: :regular, **attrs) {|_self| ... } ⇒ DropdownButtonComponent
Returns a new instance of DropdownButtonComponent.
18 19 20 21 22 23 24 25 |
# File 'app/components/panda/core/admin/dropdown_button_component.rb', line 18 def initialize(text: "Options", action: :secondary, icon: nil, size: :regular, **attrs) @text = text @action = action @icon = icon @size = size super(**attrs) yield self if block_given? end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
27 28 29 |
# File 'app/components/panda/core/admin/dropdown_button_component.rb', line 27 def action @action end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
27 28 29 |
# File 'app/components/panda/core/admin/dropdown_button_component.rb', line 27 def icon @icon end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
27 28 29 |
# File 'app/components/panda/core/admin/dropdown_button_component.rb', line 27 def size @size end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
27 28 29 |
# File 'app/components/panda/core/admin/dropdown_button_component.rb', line 27 def text @text end |