Class: UI::ScrollAreaViewportComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::ScrollAreaViewportComponent
- Includes:
- ScrollAreaViewportBehavior
- Defined in:
- app/view_components/ui/scroll_area_viewport_component.rb
Overview
ViewportComponent - ViewComponent implementation
Scrollable content container with hidden native scrollbar.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ ScrollAreaViewportComponent
constructor
A new instance of ScrollAreaViewportComponent.
Methods included from ScrollAreaViewportBehavior
#scroll_area_viewport_classes, #scroll_area_viewport_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ ScrollAreaViewportComponent
Returns a new instance of ScrollAreaViewportComponent.
16 17 18 19 |
# File 'app/view_components/ui/scroll_area_viewport_component.rb', line 16 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/view_components/ui/scroll_area_viewport_component.rb', line 21 def call = .deep_merge(@attributes) # Add Stimulus target [:data] ||= {} [:data][:"ui--scroll-area-target"] = "viewport" content_tag :div, ** do content_tag :div, content, style: "min-width: 100%; display: table;" end end |