Class: UI::ScrollAreaScrollbarComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ScrollAreaScrollbarComponent
- Includes:
- ScrollAreaScrollbarBehavior
- Defined in:
- app/view_components/ui/scroll_area_scrollbar_component.rb
Overview
ScrollbarComponent - ViewComponent implementation
Custom scrollbar track that contains the draggable thumb.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(orientation: "vertical", classes: "", **attributes) ⇒ ScrollAreaScrollbarComponent
constructor
A new instance of ScrollAreaScrollbarComponent.
Methods included from ScrollAreaScrollbarBehavior
#scroll_area_scrollbar_classes, #scroll_area_scrollbar_html_attributes
Constructor Details
#initialize(orientation: "vertical", classes: "", **attributes) ⇒ ScrollAreaScrollbarComponent
Returns a new instance of ScrollAreaScrollbarComponent.
18 19 20 21 22 |
# File 'app/view_components/ui/scroll_area_scrollbar_component.rb', line 18 def initialize(orientation: "vertical", classes: "", **attributes) @orientation = orientation @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/view_components/ui/scroll_area_scrollbar_component.rb', line 24 def call = .deep_merge(@attributes) # Add Stimulus target [:data] ||= {} [:data][:"ui--scroll-area-target"] = "scrollbar" content_tag :div, ** do render UI::ThumbComponent.new end end |