Class: UI::TooltipContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::TooltipContentComponent
- Includes:
- TooltipContentBehavior
- Defined in:
- app/view_components/ui/tooltip_content_component.rb
Overview
ContentComponent - ViewComponent implementation
The popup content that displays tooltip information. Positioned by Floating UI via Stimulus controller.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(side: "top", align: "center", side_offset: 4, classes: "", **attributes) ⇒ TooltipContentComponent
constructor
A new instance of TooltipContentComponent.
Methods included from TooltipContentBehavior
#tooltip_content_classes, #tooltip_content_data_attributes, #tooltip_content_html_attributes
Constructor Details
#initialize(side: "top", align: "center", side_offset: 4, classes: "", **attributes) ⇒ TooltipContentComponent
Returns a new instance of TooltipContentComponent.
15 16 17 18 19 20 21 |
# File 'app/view_components/ui/tooltip_content_component.rb', line 15 def initialize(side: "top", align: "center", side_offset: 4, classes: "", **attributes) @side = side @align = align @side_offset = side_offset @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
23 24 25 26 27 |
# File 'app/view_components/ui/tooltip_content_component.rb', line 23 def call content_tag :div, **tooltip_content_html_attributes.merge(@attributes.except(:data)) do content end end |