Class: Blacklight::System::DropdownButtonComponent
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Blacklight::System::DropdownButtonComponent
- Defined in:
- app/components/blacklight/system/dropdown_button_component.rb
Constant Summary
Constants inherited from Component
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(label:, classes: %w[btn btn-outline-secondary dropdown-toggle])) ⇒ DropdownButtonComponent
constructor
A new instance of DropdownButtonComponent.
Methods inherited from Component
Constructor Details
#initialize(label:, classes: %w[btn btn-outline-secondary dropdown-toggle])) ⇒ DropdownButtonComponent
Returns a new instance of DropdownButtonComponent.
6 7 8 9 |
# File 'app/components/blacklight/system/dropdown_button_component.rb', line 6 def initialize(label:, classes: %w[btn btn-outline-secondary dropdown-toggle]) @classes = classes @label = label end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 |
# File 'app/components/blacklight/system/dropdown_button_component.rb', line 11 def call class: @classes, aria: { expanded: false }, data: { toggle: 'dropdown', 'bs-toggle': 'dropdown' } do safe_join([@label, content_tag(:span, '', class: 'caret')]) end end |