Class: UI::SelectScrollUpButtonComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::SelectScrollUpButtonComponent
- Includes:
- SelectScrollUpButtonBehavior
- Defined in:
- app/view_components/ui/select_scroll_up_button_component.rb
Overview
ScrollUpButtonComponent - ViewComponent implementation
Button that appears when content is scrollable upward. Automatically hidden when at top of list.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ SelectScrollUpButtonComponent
constructor
A new instance of SelectScrollUpButtonComponent.
Methods included from SelectScrollUpButtonBehavior
#select_scroll_up_button_classes, #select_scroll_up_button_data_attributes, #select_scroll_up_button_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ SelectScrollUpButtonComponent
Returns a new instance of SelectScrollUpButtonComponent.
15 16 17 18 |
# File 'app/view_components/ui/select_scroll_up_button_component.rb', line 15 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/view_components/ui/select_scroll_up_button_component.rb', line 20 def call content_tag :div, **.deep_merge(@attributes) do content_tag :svg, nil, class: "size-4", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", stroke_width: "2", stroke_linecap: "round", stroke_linejoin: "round" do content_tag :path, nil, d: "m18 15-6-6-6 6" end end end |